Kaynağa Gözat

Allows ImageControls to act as buttons.

Adam Blake 12 yıl önce
ebeveyn
işleme
85a8f3abef
2 değiştirilmiş dosya ile 9 ekleme ve 2 silme
  1. 5 0
      gameplay/src/ImageControl.cpp
  2. 4 2
      gameplay/src/ImageControl.h

+ 5 - 0
gameplay/src/ImageControl.cpp

@@ -113,6 +113,11 @@ const Rectangle& ImageControl::getRegionDst() const
     return _dstRegion;
 }
 
+const char* ImageControl::getType() const
+{
+    return "image";
+}
+
 void ImageControl::drawImages(SpriteBatch* spriteBatch, const Rectangle& clip)
 {
     spriteBatch->finish();

+ 4 - 2
gameplay/src/ImageControl.h

@@ -1,7 +1,7 @@
 #ifndef IMAGECONTROL_H_
 #define IMAGECONTROL_H_
 
-#include "Control.h"
+#include "Button.h"
 #include "Theme.h"
 #include "Image.h"
 #include "SpriteBatch.h"
@@ -33,7 +33,7 @@ namespace gameplay
      }
  @endverbatim
  */
-class ImageControl : public Control
+class ImageControl : public Button
 {
     friend class Container;
 
@@ -107,6 +107,8 @@ public:
      */
     const Rectangle& getRegionDst() const;
 
+    const char* getType() const;
+
 protected:
 
     ImageControl();