Browse Source

TurboBadger TBImage fixes for when using from C++

Josh Engebretson 11 years ago
parent
commit
8968bec9d1

+ 1 - 1
Bin/CoreData/AtomicModules/AtomicGame.js

@@ -80,7 +80,7 @@ Game.prototype.createScene2D = function() {
         var width = (_viewport.right - 8) - _viewport.left;
         var width = (_viewport.right - 8) - _viewport.left;
         var height = _viewport.bottom - _viewport.top;
         var height = _viewport.bottom - _viewport.top;
 
 
-        this.ui.getRoot().setPosition(_viewport.left, _viewport.top);
+        this.ui.getRoot().position = [_viewport.left, _viewport.top];
         this.ui.getRoot().setSize(width, height);        
         this.ui.getRoot().setSize(width, height);        
     }
     }
 
 

+ 5 - 5
Source/ThirdParty/TurboBadger/image/tb_image_manager.h

@@ -6,14 +6,14 @@
 #ifndef TB_IMAGE_MANAGER_H
 #ifndef TB_IMAGE_MANAGER_H
 #define TB_IMAGE_MANAGER_H
 #define TB_IMAGE_MANAGER_H
 
 
-#include "tb_core.h"
+#include "../tb_core.h"
 
 
 #ifdef TB_IMAGE
 #ifdef TB_IMAGE
 
 
-#include "tb_linklist.h"
-#include "tb_hashtable.h"
-#include "tb_bitmap_fragment.h"
-#include "tb_renderer.h"
+#include "../tb_linklist.h"
+#include "../tb_hashtable.h"
+#include "../tb_bitmap_fragment.h"
+#include "../tb_renderer.h"
 
 
 namespace tb {
 namespace tb {
 
 

+ 5 - 2
Source/ThirdParty/TurboBadger/image/tb_image_widget.h

@@ -6,11 +6,11 @@
 #ifndef TB_IMAGE_WIDGET_H
 #ifndef TB_IMAGE_WIDGET_H
 #define TB_IMAGE_WIDGET_H
 #define TB_IMAGE_WIDGET_H
 
 
-#include "tb_widgets.h"
+#include "../tb_widgets.h"
 
 
 #ifdef TB_IMAGE
 #ifdef TB_IMAGE
 
 
-#include "image/tb_image_manager.h"
+#include "tb_image_manager.h"
 
 
 namespace tb {
 namespace tb {
 
 
@@ -29,6 +29,9 @@ public:
 	void SetImage(const TBImage &image) { m_image = image; }
 	void SetImage(const TBImage &image) { m_image = image; }
 	void SetImage(const char *filename) { m_image = g_image_manager->GetImage(filename); }
 	void SetImage(const char *filename) { m_image = g_image_manager->GetImage(filename); }
 
 
+    int32 GetImageWidth() { return m_image.Width(); }
+    int32 GetImageHeight() { return m_image.Height(); }
+
 	virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
 	virtual PreferredSize OnCalculatePreferredContentSize(const SizeConstraints &constraints);
 
 
 	virtual void OnInflate(const INFLATE_INFO &info);
 	virtual void OnInflate(const INFLATE_INFO &info);

+ 2 - 1
Source/Tools/JSBind/modules/UI.json

@@ -13,7 +13,8 @@
 		"UIElement" : {
 		"UIElement" : {
 			"SetColor" : ["Color"],
 			"SetColor" : ["Color"],
 			"SetPosition" : ["IntVector2"],
 			"SetPosition" : ["IntVector2"],
-			"SetSize" : ["int", "int"]
+			"SetSize" : ["int", "int"],
+			"SetMinSize" : ["int", "int"]
 		}
 		}
 
 
 	}
 	}