dmuratshin 9 vuotta sitten
vanhempi
sitoutus
1941d00dfe
2 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 6 1
      examples/HelloWorld/src/example.cpp
  2. 6 1
      oxygine/src/res/SingleResAnim.cpp

+ 6 - 1
examples/HelloWorld/src/example.cpp

@@ -1,5 +1,6 @@
 #include "oxygine-framework.h"
 #include <functional>
+#include "res/SingleResAnim.h"
 using namespace oxygine;
 
 //it is our resources
@@ -19,9 +20,13 @@ public:
         //create button Sprite
         spSprite button = new Sprite();
 
+		static SingleResAnim rs;
+		rs.init("images/button.png");
+
         //setup it:
         //set button.png image. Resource 'button' defined in 'res.xml'
-        button->setResAnim(gameResources.getResAnim("button"));
+        //button->setResAnim(gameResources.getResAnim("button"));
+		button->setResAnim(&rs);
 
         //centered button at screen
         Vector2 pos = getStage()->getSize() / 2 - button->getSize() / 2;

+ 6 - 1
oxygine/src/res/SingleResAnim.cpp

@@ -1,4 +1,5 @@
 #include "SingleResAnim.h"
+#include "Image.h"
 
 namespace oxygine
 {
@@ -11,6 +12,10 @@ namespace oxygine
 
 	void SingleResAnim::init(Image* original, int columns, int rows, float scaleFactor)
 	{
-		makeAlpha
+		Rect bounds;
+		HitTestData ht;
+		const ImageData &im = original->lock();
+		makeAlpha(im, bounds, _data, ht, true);
+		int q = 0;
 	}
 }