dm 7 years ago
parent
commit
fd88765617
3 changed files with 13 additions and 11 deletions
  1. 2 2
      examples/Demo/src/example.cpp
  2. 0 0
      examples/Demo/src/test.cpp
  3. 11 9
      examples/Demo/src/test.h

+ 2 - 2
examples/Demo/src/example.cpp

@@ -171,8 +171,8 @@ void example_init()
     resources.loadXML("xmls/res.xml");
     
 
-    Test::_instance = new TestActor;
-    getStage()->addChild(Test::_instance);
+    Test::instance = new TestActor;
+    Test::instance->attachTo(getStage());
 
     //Initialize http requests
     HttpRequestTask::init();

File diff suppressed because it is too large
+ 0 - 0
examples/Demo/src/test.cpp


+ 11 - 9
examples/Demo/src/test.h

@@ -19,7 +19,7 @@ public:
     static void init();
     static void free();
 
-    static spTest _instance;
+    static spTest instance;
     static Resources _resources;
 
     struct toggle
@@ -29,7 +29,6 @@ public:
         const void* data;
         toggle() {}
         toggle(const char* text_, int v_ = 0, const void* data_ = 0): text(text_), value(v_), data(data_) {}
-
     };
 
     spButton addButton(string id, string txt);
@@ -37,22 +36,25 @@ public:
     void updateText(string id, string txt);
     virtual void clicked(string id) {}
     virtual void toggleClicked(string id, const toggle* data) {}
-    void _clicked(Event* event);
-    void _toggleClicked(Event* event);
-    void back(Event* event);
-
+    
+        
     void notify(string text, int time = 400);
 
 protected:
     void notifyDone(Event* ev);
+    void _clicked(Event* event);
+    void _toggleClicked(Event* event);
+    void _back(Event* event);
 
     Color _color;
     Color _txtColor;
 
-    float _x;
-    float _y;
-    spActor _ui;
     spActor _content;
+    spActor _ui;
+
+    float _x;
+    float _y;    
+    
     enum {MAX_NOTIFIES = 8};
     int _notifies[MAX_NOTIFIES];
 };

Some files were not shown because too many files changed in this diff