Ivan Safrin 12 лет назад
Родитель
Сommit
124e0641ba
45 измененных файлов с 362 добавлено и 212 удалено
  1. 3 3
      IDE/Contents/Include/PolycodeConsole.h
  2. 3 3
      IDE/Contents/Include/PolycodeFrame.h
  3. 5 5
      IDE/Contents/Include/PolycodeImageEditor.h
  4. 8 8
      IDE/Contents/Include/PolycodeMaterialEditor.h
  5. 1 1
      IDE/Contents/Include/PolycodeProjectBrowser.h
  6. 1 1
      IDE/Contents/Include/PolycodeProjectEditor.h
  7. 4 4
      IDE/Contents/Include/PolycodeProps.h
  8. 1 1
      IDE/Contents/Include/PolycodeSpriteEditor.h
  9. 1 1
      IDE/Contents/Include/PolycodeTextEditor.h
  10. 3 3
      IDE/Contents/Include/TextureBrowser.h
  11. 6 6
      IDE/Contents/Source/PolycodeConsole.cpp
  12. 1 1
      IDE/Contents/Source/PolycodeFontEditor.cpp
  13. 6 6
      IDE/Contents/Source/PolycodeFrame.cpp
  14. 11 11
      IDE/Contents/Source/PolycodeImageEditor.cpp
  15. 15 15
      IDE/Contents/Source/PolycodeMaterialEditor.cpp
  16. 2 2
      IDE/Contents/Source/PolycodeProjectBrowser.cpp
  17. 2 2
      IDE/Contents/Source/PolycodeProjectEditor.cpp
  18. 7 7
      IDE/Contents/Source/PolycodeProps.cpp
  19. 2 2
      IDE/Contents/Source/PolycodeSpriteEditor.cpp
  20. 2 2
      IDE/Contents/Source/PolycodeTextEditor.cpp
  21. 4 4
      IDE/Contents/Source/TextureBrowser.cpp
  22. 9 9
      Modules/Contents/UI/Include/PolyUIBox.h
  23. 2 2
      Modules/Contents/UI/Include/PolyUIColorBox.h
  24. 26 0
      Modules/Contents/UI/Include/PolyUIElement.h
  25. 1 1
      Modules/Contents/UI/Include/PolyUIFileDialog.h
  26. 2 2
      Modules/Contents/UI/Include/PolyUIHSizer.h
  27. 1 1
      Modules/Contents/UI/Include/PolyUIHSlider.h
  28. 1 1
      Modules/Contents/UI/Include/PolyUIImageButton.h
  29. 2 2
      Modules/Contents/UI/Include/PolyUIMenuBar.h
  30. 5 5
      Modules/Contents/UI/Include/PolyUITextInput.h
  31. 1 2
      Modules/Contents/UI/Include/PolyUITree.h
  32. 2 2
      Modules/Contents/UI/Include/PolyUIVSizer.h
  33. 1 1
      Modules/Contents/UI/Include/PolyUIWindow.h
  34. 46 58
      Modules/Contents/UI/Source/PolyUIBox.cpp
  35. 2 2
      Modules/Contents/UI/Source/PolyUIColorBox.cpp
  36. 137 0
      Modules/Contents/UI/Source/PolyUIElement.cpp
  37. 1 1
      Modules/Contents/UI/Source/PolyUIFileDialog.cpp
  38. 6 6
      Modules/Contents/UI/Source/PolyUIHSizer.cpp
  39. 2 2
      Modules/Contents/UI/Source/PolyUIHSlider.cpp
  40. 1 1
      Modules/Contents/UI/Source/PolyUIImageButton.cpp
  41. 3 3
      Modules/Contents/UI/Source/PolyUIMenuBar.cpp
  42. 14 14
      Modules/Contents/UI/Source/PolyUITextInput.cpp
  43. 2 2
      Modules/Contents/UI/Source/PolyUITree.cpp
  44. 6 6
      Modules/Contents/UI/Source/PolyUIVSizer.cpp
  45. 1 1
      Modules/Contents/UI/Source/PolyUIWindow.cpp

+ 3 - 3
IDE/Contents/Include/PolycodeConsole.h

@@ -61,7 +61,7 @@ class BackTraceEntry : public UIElement {
 		String fileName;
 		unsigned int lineNumber;
 		
-		ScenePrimitive *labelBg;	
+		UIRect *labelBg;	
 		SceneLabel *label;
 };
 
@@ -81,7 +81,7 @@ class BackTraceWindow : public UIElement {
 		void adjustEntries();
 		
 	protected:			
-		ScenePrimitive *labelBg;
+		UIRect *labelBg;
 		std::vector<BackTraceEntry*> entries;
 		
 };
@@ -99,7 +99,7 @@ class ConsoleWindow : public UIElement {
 		UIImageButton *clearButton;
 		UIImageButton *hideConsoleButton;
 		
-		ScenePrimitive *labelBg;
+		UIRect *labelBg;
 };
 
 class PolycodeConsole : public UIElement {

+ 3 - 3
IDE/Contents/Include/PolycodeFrame.h

@@ -233,9 +233,9 @@ private:
 	bool showingConsole;
 	Number consoleSize;
 
-	ScenePrimitive *fileDialogBlocker;
+	UIRect *fileDialogBlocker;
 
-	ScenePrimitive *topBarBg;
+	UIRect *topBarBg;
 	UIImage *logo;	
 	UIImage *resizer;	
 
@@ -255,7 +255,7 @@ private:
 
 	vector<PolycodeEditor*> editors;
 	
-	ScenePrimitive *modalBlocker;
+	UIRect *modalBlocker;
 	UIWindow *modalChild;		
 	
 	UIVSizer *consoleSizer;

+ 5 - 5
IDE/Contents/Include/PolycodeImageEditor.h

@@ -39,12 +39,12 @@ class PolycodeImageEditor : public PolycodeEditor {
 	protected:
 		UIImage *grid;
 	
-		ScenePrimitive *editorImage;
+		UIRect *editorImage;
 		
-		ScenePrimitive *leftShape;		
-		ScenePrimitive *rightShape;		
-		ScenePrimitive *topShape;		
-		ScenePrimitive *bottomShape;								
+		UIRect *leftShape;		
+		UIRect *rightShape;		
+		UIRect *topShape;		
+		UIRect *bottomShape;								
 		
 		Number aspectRatio;
 };

+ 8 - 8
IDE/Contents/Include/PolycodeMaterialEditor.h

@@ -60,7 +60,7 @@ class MaterialPreviewBox : public UIElement {
 		SceneLight *mainLight;
 		SceneLight *secondLight;		
 		SceneRenderTexture *renderTexture;
-		ScenePrimitive *previewShape;
+		UIRect *previewShape;
 		
 		std::vector<UIImageButton*> shapeSwitches;
 		std::vector<ScenePrimitive*> shapePrimitives;
@@ -83,11 +83,11 @@ class PostPreviewBox : public UIElement {
 			
 		Scene *previewScene;
 		SceneRenderTexture *renderTexture;
-		ScenePrimitive *previewShape;				
+		UIRect *previewShape;				
 		Entity *previewBase;		
 		ScenePrimitive *previewPrimitive;	
 		Material *currentMaterial;	
-		ScenePrimitive *headerBg;
+		UIRect *headerBg;
 				
 		Number spinValue;
 		
@@ -131,7 +131,7 @@ class MaterialBrowser : public UIElement {
 														
 	protected:
 	
-		ScenePrimitive *headerBg;
+		UIRect *headerBg;
 		UITree *shadersNode;
 		UITree *materialsNode;
 		UITree *cubemapsNode;
@@ -152,7 +152,7 @@ class CubemapEditorPane : public UIElement {
 	protected:
 	
 		PropList *propList;
-		ScenePrimitive *headerBg;
+		UIRect *headerBg;
 		
 		TextureProp *yPosTexture;
 		TextureProp *yNegTexture;
@@ -179,7 +179,7 @@ class PostEditorPane : public UIElement {
 		
 		protected:
 		
-		ScenePrimitive *headerBgBottom;
+		UIRect *headerBgBottom;
 
 		PropList *propList;				
 		PropSheet *baseProps;
@@ -228,7 +228,7 @@ class ShaderEditorPane : public UIElement {
 		bool choosingVertexProgram;
 	
 		PropList *propList;
-		ScenePrimitive *headerBg;
+		UIRect *headerBg;
 		
 		ComboProp *vertexProgramProp;
 		ComboProp *fragmentProgramProp;
@@ -258,7 +258,7 @@ class MaterialEditorPane : public UIElement {
 		MaterialPreviewBox *materialPreview;
 		bool changingMaterial;
 	
-		ScenePrimitive *headerBg;			
+		UIRect *headerBg;			
 		
 		PropList *propList;
 		

+ 1 - 1
IDE/Contents/Include/PolycodeProjectBrowser.h

@@ -75,7 +75,7 @@ public:
 			
 protected:
 
-		ScenePrimitive *headerBg;
+		UIRect *headerBg;
 	
 		UIMenu *contextMenu;
 	

+ 1 - 1
IDE/Contents/Include/PolycodeProjectEditor.h

@@ -74,7 +74,7 @@ class PolycodeProjectEditor : public PolycodeEditor {
 	UIElement *mainSettingsWindow;
 	UIElement *moduleSettingsWindow;
 	
-	ScenePrimitive *headerBg;
+	UIRect *headerBg;
 	
 	UIElement *fontEntryBase;	
 	std::vector<ProjectFontEntry*> fontEntries;

+ 4 - 4
IDE/Contents/Include/PolycodeProps.h

@@ -312,7 +312,7 @@ class TextureProp : public PropProp {
 		
 		void setPropData(PolycodeEditorPropActionData* data);
 				
-		ScenePrimitive *previewShape;
+		UIRect *previewShape;
 		UIButton *changeButton;
 		SceneLabel *textureLabel;
 		
@@ -378,7 +378,7 @@ class PropSheet : public UIElement {
 		Number propHeight;				
 		Entity *contents;
 		
-		ScenePrimitive *bg;
+		UIRect *bg;
 		
 		UIImageButton *collapseButton;
 		UIImageButton *expandButton;
@@ -618,8 +618,8 @@ class PropList : public UIElement {
 		Entity *propContents;
 	
 		std::vector<PropSheet*> props;	
-		ScenePrimitive *bg;
-		ScenePrimitive *bg2;				
+		UIRect *bg;
+		UIRect *bg2;				
 };
 
 class PolycodeEditorPropActionData : public PolycodeEditorActionData {

+ 1 - 1
IDE/Contents/Include/PolycodeSpriteEditor.h

@@ -69,7 +69,7 @@ class PolycodeSpriteEditor : public PolycodeEditor {
 	
 	PropList *propList;
 	
-	ScenePrimitive *headerBg;	
+	UIRect *headerBg;	
 	
 	UIComboBox *zoomBox;
 	

+ 1 - 1
IDE/Contents/Include/PolycodeTextEditor.h

@@ -56,7 +56,7 @@ class FindBar : public UIElement {
 		UIComboBox *functionList;
 		
 	protected:
-		ScenePrimitive *barBg;
+		UIRect *barBg;
 		
 };
 

+ 3 - 3
IDE/Contents/Include/TextureBrowser.h

@@ -41,12 +41,12 @@ class AssetEntry : public UIElement {
 		AssetEntry(String assetPath, String assetName, String extension);
 		~AssetEntry();
 		
-		ScenePrimitive *imageShape;
+		UIRect *imageShape;
 		SceneLabel *nameLabel;
 		
 		String assetPath;
 		
-		ScenePrimitive *selectShape;
+		UIRect *selectShape;
 };
 
 class AssetList : public UIElement {
@@ -68,7 +68,7 @@ class AssetList : public UIElement {
 		UIImageButton *reloadButton;
 	
 		String currentFolderPath;
-		ScenePrimitive *bgShape;
+		UIRect *bgShape;
 	
 		AssetEntry *currentEntry;		
 		std::vector<AssetEntry*> assetEntries;

+ 6 - 6
IDE/Contents/Source/PolycodeConsole.cpp

@@ -40,7 +40,7 @@ BackTraceEntry::BackTraceEntry(String fileName, int lineNumber, PolycodeProject
 	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
 	int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize");	
 
-	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,20);
+	labelBg = new UIRect(20,20);
 	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->setColor(0.0, 0.0, 0.0, 0.15);
 	labelBg->processInputEvents = true;
@@ -84,7 +84,7 @@ BackTraceEntry::~BackTraceEntry() {
 }
 
 void BackTraceEntry::Resize(Number width, Number height) {
-	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 20);
+	labelBg->Resize(width, 20);
 
 }
 
@@ -93,7 +93,7 @@ BackTraceWindow::BackTraceWindow() : UIElement() {
 	Config *conf = CoreServices::getInstance()->getConfig();	
 	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
 
-	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,30);
+	labelBg = new UIRect(20,30);
 	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(labelBg);
@@ -106,7 +106,7 @@ BackTraceWindow::BackTraceWindow() : UIElement() {
 }	
 
 void BackTraceWindow::Resize(Number width, Number height) {
-	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	labelBg->Resize(width, 30);
 	setWidth(width);
 	setHeight(height);
 	adjustEntries();
@@ -167,7 +167,7 @@ BackTraceWindow::~BackTraceWindow() {
 ConsoleWindow::ConsoleWindow() : UIElement() {
 
 
-	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,30);
+	labelBg = new UIRect(20,30);
 	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(labelBg);
@@ -193,7 +193,7 @@ ConsoleWindow::ConsoleWindow() : UIElement() {
 
 void ConsoleWindow::Resize(Number width, Number height) {
 
-	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	labelBg->Resize(width, 30);
 	debugTextInput->Resize(width, height-25-30);
 	debugTextInput->setPosition(0, 30);
 

+ 1 - 1
IDE/Contents/Source/PolycodeFontEditor.cpp

@@ -49,7 +49,7 @@ bool PolycodeFontEditor::openFile(OSFileEntry filePath) {
 	grid->getImage()->getTexture()->clamp = false;
 	grid->getImage()->getTexture()->recreateFromImageData();	
 	
-//	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+//	bg = new UIRect(10,10);
 	bg = new UIBox("Images/fontBox.png", 29,9,9,9, 10,10);	
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->setPosition(-50,-50);

+ 6 - 6
IDE/Contents/Source/PolycodeFrame.cpp

@@ -540,7 +540,7 @@ PolycodeFrame::PolycodeFrame() : UIElement() {
 		
 	projectBrowser->treeContainer->getRootNode()->addEventListener(this, UITreeEvent::DRAG_START_EVENT);
 	
-	topBarBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 2,2);
+	topBarBg = new UIRect(2,2);
 	topBarBg->setColorInt(21, 18, 17, 255);
 	topBarBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	topBarBg->processInputEvents = true;
@@ -576,7 +576,7 @@ PolycodeFrame::PolycodeFrame() : UIElement() {
 	addChild(resizer);
 	resizer->setColor(0,0,0,0.4);
 	
-	modalBlocker = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	modalBlocker = new UIRect(10,10);
 	modalBlocker->setColor(0,0,0,0.4);
 	modalBlocker->setAnchorPoint(-1.0, -1.0, 0.0);
 	modalBlocker->enabled = false;	
@@ -656,7 +656,7 @@ PolycodeFrame::PolycodeFrame() : UIElement() {
 	modalRoot = new UIElement();
 	addChild(modalRoot);
 	
-	fileDialogBlocker = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 100, 100);
+	fileDialogBlocker = new UIRect(100, 100);
 	fileDialogBlocker->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(fileDialogBlocker);
 	fileDialogBlocker->setColor(0.0, 0.0, 0.0, 0.5);
@@ -924,13 +924,13 @@ void PolycodeFrame::Resize(int x, int y) {
 	welcomeEntity->setPosition((x-welcomeImage->getWidth()) / 2,
 		(y-welcomeImage->getHeight()) / 2); 
 	
-	topBarBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, 45);
+	topBarBg->Resize(x, 45);
 	logo->setPosition(x-logo->getWidth()-2, 2);
 	resizer->setPosition(x-resizer->getWidth()-1, y-resizer->getHeight()-1);	
 	mainSizer->Resize(x,y-45);	
 	
-	modalBlocker->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, y);
-	fileDialogBlocker->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, y);
+	modalBlocker->Resize(x, y);
+	fileDialogBlocker->Resize(x, y);
 		
 	currentFileSelector->setPosition(x-400, 11);
 	closeFileButton->setPosition(currentFileSelector->getPosition().x-20, currentFileSelector->getPosition().y+6);

+ 11 - 11
IDE/Contents/Source/PolycodeImageEditor.cpp

@@ -46,28 +46,28 @@ bool PolycodeImageEditor::openFile(OSFileEntry filePath) {
 	grid->getImage()->getTexture()->recreateFromImageData();	
 		
 	
-	leftShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	leftShape = new UIRect(10,10);
 	leftShape->setColor(0.0, 0.0, 0.0, 0.3);
 	leftShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(leftShape);
 
-	rightShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	rightShape = new UIRect(10,10);
 	rightShape->setColor(0.0, 0.0, 0.0, 0.3);
 	rightShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(rightShape);
 
-	topShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	topShape = new UIRect(10,10);
 	topShape->setColor(0.0, 0.0, 0.0, 0.3);
 	topShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(topShape);
 
-	bottomShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	bottomShape = new UIRect(10,10);
 	bottomShape->setColor(0.0, 0.0, 0.0, 0.3);
 	bottomShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bottomShape);
 		
 		
-	editorImage = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	editorImage = new UIRect(10,10);
 	
 	Texture *newTexture = CoreServices::getInstance()->getMaterialManager()->createTextureFromFile(filePath.fullPath);
 	newTexture->reloadOnFileModify = true;
@@ -90,19 +90,19 @@ void PolycodeImageEditor::Resize(int x, int y) {
 	grid->getImage()->setImageCoordinates(0,0,x,y);	
 	
 	if((y * 0.8) * aspectRatio > x * 0.8) {
-		editorImage->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x * 0.8), (x * 0.8) / aspectRatio);	
+		editorImage->Resize((x * 0.8), (x * 0.8) / aspectRatio);	
 	} else {
-		editorImage->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (y * 0.8) * aspectRatio, (y * 0.8));
+		editorImage->Resize((y * 0.8) * aspectRatio, (y * 0.8));
 	}
 	
-	leftShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x - editorImage->getWidth())/2.0, y);	
-	rightShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x - editorImage->getWidth())/2.0, y);	
+	leftShape->Resize((x - editorImage->getWidth())/2.0, y);	
+	rightShape->Resize((x - editorImage->getWidth())/2.0, y);	
 	rightShape->setPosition(leftShape->getWidth() + editorImage->getWidth(), 0);
 		
-	topShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
+	topShape->Resize(editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
 	topShape->setPosition(leftShape->getWidth(),0);
 
-	bottomShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
+	bottomShape->Resize(editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
 	bottomShape->setPosition(leftShape->getWidth(),y-bottomShape->getHeight());
 
 		

+ 15 - 15
IDE/Contents/Source/PolycodeMaterialEditor.cpp

@@ -33,7 +33,7 @@ PostEditorPane::PostEditorPane() : UIElement() {
 	
 	bottomElement = new UIElement();
 	
-	headerBgBottom = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBgBottom = new UIRect(10,10);
 	bottomElement->addChild(headerBgBottom);
 	headerBgBottom->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBgBottom->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -101,7 +101,7 @@ PostEditorPane::~PostEditorPane() {
 void PostEditorPane::Resize(Number width, Number height) {
 	mainSizer->Resize(width, height);
 	
-	headerBgBottom->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	headerBgBottom->Resize(width, 30);	
 	propList->Resize(width/2.0, height- mainSizer->getMainHeight());
 	
 	propList->updateProps();
@@ -190,7 +190,7 @@ void PostEditorPane::handleEvent(Event *event) {
 CubemapEditorPane::CubemapEditorPane() : UIElement() {
 	currentCubemap = NULL;
 
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -312,7 +312,7 @@ CubemapEditorPane::~CubemapEditorPane() {
 }
 
 void CubemapEditorPane::Resize(Number width, Number height) {
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	headerBg->Resize(width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
@@ -323,7 +323,7 @@ ShaderEditorPane::ShaderEditorPane() : UIElement() {
 	changingShader = false;
 	currentShader = NULL;
 
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -509,14 +509,14 @@ void ShaderEditorPane::setShader(Shader *shader) {
 }
 
 void ShaderEditorPane::Resize(Number width, Number height) {
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	headerBg->Resize(width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
 
 PostPreviewBox::PostPreviewBox() : UIElement() {
 
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -583,7 +583,7 @@ PostPreviewBox::PostPreviewBox() : UIElement() {
 	previewBase->setPosition(0, 30);
 	addChild(previewBase);
 	
-	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 256, 256);
+	previewShape = new UIRect(256, 256);
 	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);	
 	previewShape->setTexture(renderTexture->getTargetTexture());
 //	previewShape->strokeEnabled = true;
@@ -634,8 +634,8 @@ void PostPreviewBox::Update() {
 }
 
 void PostPreviewBox::Resize(Number width, Number height) {
-	previewShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, height-30);
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	previewShape->Resize(width, height-30);
+	headerBg->Resize(width, 30);
 	
 	int textureWidth = (int)width;
 	int textureHeight = (int) (height-30);
@@ -738,7 +738,7 @@ MaterialPreviewBox::MaterialPreviewBox() : UIElement() {
 	previewBase->setPosition(0, 0);
 	addChild(previewBase);
 	
-	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 256, 256);
+	previewShape = new UIRect(256, 256);
 	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);	
 	previewShape->setTexture(renderTexture->getTargetTexture());
 	previewShape->setPosition(20,40);
@@ -803,7 +803,7 @@ MaterialEditorPane::MaterialEditorPane() : UIElement() {
 
 	changingMaterial = false;
 	
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -873,7 +873,7 @@ void MaterialEditorPane::reloadShaders() {
 }
 
 void MaterialEditorPane::Resize(Number width, Number height) {
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	headerBg->Resize(width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
@@ -1005,7 +1005,7 @@ MaterialBrowser::MaterialBrowser() : UIElement() {
 	addChild(treeContainer);		
 	selectedData = NULL;
 	
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
@@ -1083,7 +1083,7 @@ MaterialBrowser::~MaterialBrowser() {
 void MaterialBrowser::Resize(Number width, Number height) {
 	treeContainer->Resize(width, height-30);
 	treeContainer->setPosition(0, 30);	
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	headerBg->Resize(width, 30);	
 	removeButton->setPosition(width - 24, 8);
 }
 

+ 2 - 2
IDE/Contents/Source/PolycodeProjectBrowser.cpp

@@ -26,7 +26,7 @@ extern UIGlobalMenu *globalMenu;
 
 PolycodeProjectBrowser::PolycodeProjectBrowser() : UIElement() {
 
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
@@ -205,6 +205,6 @@ void PolycodeProjectBrowser::parseFolderIntoNode(UITree *node, String spath, Pol
 }
 
 void PolycodeProjectBrowser::Resize(Number width, Number height) {
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	headerBg->Resize(width, 30);
 	treeContainer->Resize(width, height-30);
 }

+ 2 - 2
IDE/Contents/Source/PolycodeProjectEditor.cpp

@@ -96,7 +96,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding");	
 		
 
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
@@ -407,7 +407,7 @@ bool PolycodeProjectEditor::openFile(OSFileEntry filePath) {
 
 void PolycodeProjectEditor::Resize(int x, int y) {
 	
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, 30);
+	headerBg->Resize(x, 30);
 	
 	PolycodeEditor::Resize(x,y);	
 }

+ 7 - 7
IDE/Contents/Source/PolycodeProps.cpp

@@ -117,7 +117,7 @@ PropList::PropList(String caption) : UIElement() {
 
 	setAnchorPoint(-1.0, -1.0, 0.0);
 
-	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	bg = new UIRect(10,10);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiBgColor"));
 	
@@ -127,7 +127,7 @@ PropList::PropList(String caption) : UIElement() {
 	
 	blockMouseInput = true;
 
-	bg2 = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	bg2 = new UIRect(10,10);
 	bg2->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg2->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	
@@ -168,8 +168,8 @@ void PropList::Resize(Number width, Number height) {
 		
 	scrollContainer->Resize(width, height-30);
 	
-	bg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, height);
-	bg2->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
+	bg->Resize(width, height);
+	bg2->Resize(width, 30);	
 	
 	Number offsetY = 0;
 	for(int i=0; i < props.size(); i++) {
@@ -211,7 +211,7 @@ PropSheet::PropSheet(String caption, String type) : UIElement() {
 	
 	customUndoHandler = false;
 	
-	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,30);
+	bg = new UIRect(30,30);
 	addChild(bg);
 	bg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiSmallHeaderBgColor"));
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
@@ -289,7 +289,7 @@ void PropSheet::Resize(Number width, Number height) {
 	setWidth(width);
 	setHeight(height);
 	
-	bg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	bg->Resize(width, 30);
 	
 	Number yOffset = 0;
 	
@@ -912,7 +912,7 @@ void BezierCurveProp::handleEvent(Event *event) {
 }
 
 TextureProp::TextureProp(String caption) : PropProp(caption, "Texture"){
-	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 48, 48);
+	previewShape = new UIRect(48, 48);
 	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	previewShape->setPosition(2, 1);
 	propContents->addChild(previewShape);

+ 2 - 2
IDE/Contents/Source/PolycodeSpriteEditor.cpp

@@ -100,7 +100,7 @@ SpriteAnimationEntry::~SpriteAnimationEntry() {
 }
 
 PolycodeSpriteEditor::PolycodeSpriteEditor() : PolycodeEditor(true){
-	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
+	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
@@ -327,7 +327,7 @@ void PolycodeSpriteEditor::saveFile() {
 }
 
 void PolycodeSpriteEditor::Resize(int x, int y) {
-	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, 30);
+	headerBg->Resize(x, 30);
 	propList->Resize(370, y);
 	propList->updateProps();	
 	PolycodeEditor::Resize(x,y);	

+ 2 - 2
IDE/Contents/Source/PolycodeTextEditor.cpp

@@ -640,7 +640,7 @@ void PolycodeTextEditor::Resize(int x, int y) {
 }
 
 FindBar::FindBar() : UIElement() {
-	barBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,30);
+	barBg = new UIRect(30,30);
 	barBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	barBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(barBg);
@@ -701,7 +701,7 @@ FindBar::~FindBar(){
 }
 
 void FindBar::setBarWidth(int width) {
-	barBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	barBg->Resize(width, 30);
 	closeButton->setPosition(width - 30, 5);
 	functionList->Resize(width-560-60, functionList->getHeight());
 }

+ 4 - 4
IDE/Contents/Source/TextureBrowser.cpp

@@ -29,14 +29,14 @@ AssetEntry::AssetEntry(String assetPath, String assetName, String extension) : U
 	if(assetName.length() > 20)
 		assetName = assetName.substr(0,20)+"...";
 
-	selectShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 120, 100);
+	selectShape = new UIRect(120, 100);
 	selectShape->visible = false;
 	selectShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(selectShape);
 	selectShape->processInputEvents = true;
 	selectShape->setColor(0.0, 0.0, 0.0, 0.5);
 
-	imageShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 64,64);
+	imageShape = new UIRect(64,64);
 	imageShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(imageShape);
 	
@@ -76,7 +76,7 @@ AssetEntry::~AssetEntry() {
 
 AssetList::AssetList() : UIElement() {
 	
-	bgShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 100,100);
+	bgShape = new UIRect(100,100);
 	bgShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	bgShape->setColor(0.0, 0.0, 0.0, 0.4);
 	addChild(bgShape);
@@ -152,7 +152,7 @@ void AssetList::showFolder(String folderPath) {
 	}
 
 	
-	bgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), getHeight());
+	bgShape->Resize(getWidth(), getHeight());
 	bgShape->rebuildTransformMatrix();
 	rebuildTransformMatrix();	
 }

+ 9 - 9
Modules/Contents/UI/Include/PolyUIBox.h

@@ -41,16 +41,16 @@ namespace Polycode {
 		Number b;
 		Number l;
 		
-		SceneImage *tlImage;
-		SceneImage *trImage;		
-		SceneImage *blImage;		
-		SceneImage *brImage;			
+		UIRect *tlImage;
+		UIRect *trImage;		
+		UIRect *blImage;		
+		UIRect *brImage;			
 		
-		SceneImage *centerImage;
+		UIRect *centerImage;
 		
-		SceneImage *tImage;
-		SceneImage *rImage;
-		SceneImage *bImage;
-		SceneImage *lImage;		
+		UIRect *tImage;
+		UIRect *rImage;
+		UIRect *bImage;
+		UIRect *lImage;		
 	};
 }

+ 2 - 2
Modules/Contents/UI/Include/PolyUIColorBox.h

@@ -116,8 +116,8 @@ namespace Polycode {
 			Color selectedColor;
 				
 			UIBox *frameImage;
-			ScenePrimitive *bgImage;
-			ScenePrimitive *colorShape;			
+			UIRect *bgImage;
+			UIRect *colorShape;			
 		
 	};
 }

+ 26 - 0
Modules/Contents/UI/Include/PolyUIElement.h

@@ -79,6 +79,32 @@ namespace Polycode {
 			UIElement *focusParent;
 			
 	};
+
+	class _PolyExport UIRect : public UIElement {
+		public:
+			UIRect(String fileName);
+			UIRect(Number width, Number height);
+			void initRect(Number width, Number height);
+			~UIRect();
+			void Resize(Number width, Number height);
+			void Render();
+			void loadTexture(String fileName);
+			void setTexture(Texture *texture);
+			void setImageCoordinates(Number x, Number y, Number width, Number height);
+			Number getImageWidth() const;
+			Number getImageHeight() const;
+						
+			Texture *getTexture();			
+		protected:
+		
+			Number imageWidth;
+			Number imageHeight;
+			
+			Mesh *rectMesh;
+			Texture *texture;
+			
+	};
+
 	
 	class _PolyExport UIImage : public UIElement {
 		public:

+ 1 - 1
Modules/Contents/UI/Include/PolyUIFileDialog.h

@@ -51,7 +51,7 @@ namespace Polycode {
 			void Deselect();
 
 			bool canSelect;
-			ScenePrimitive *bg;
+			UIRect *bg;
 			SceneLabel *label;
 			OSFileEntry fileEntry;
 			SceneImage *icon;

+ 2 - 2
Modules/Contents/UI/Include/PolyUIHSizer.h

@@ -58,8 +58,8 @@ namespace Polycode {
 			
 			bool leftSizer;
 			
-			ScenePrimitive *separatorHitShape;
-			ScenePrimitive *separatorBgShape;
+			UIRect *separatorHitShape;
+			UIRect *separatorBgShape;
 			
 			UIElement *firstElement;
 			UIElement *secondElement;			

+ 1 - 1
Modules/Contents/UI/Include/PolyUIHSlider.h

@@ -65,6 +65,6 @@ namespace Polycode {
 			Number endValue;
 			Number sliderWidth;
 			
-			ScenePrimitive *bgHitBox;
+			UIRect *bgHitBox;
 	};
 }

+ 1 - 1
Modules/Contents/UI/Include/PolyUIImageButton.h

@@ -38,7 +38,7 @@ namespace Polycode {
 			void handleEvent(Event *event);
 				
 		private:
-			ScenePrimitive *buttonRect;
+			UIRect *buttonRect;
 			SceneImage *buttonImage;
 			bool pressedDown;
 	};

+ 2 - 2
Modules/Contents/UI/Include/PolyUIMenuBar.h

@@ -55,7 +55,7 @@ namespace Polycode {
 			void Select();
 			void Deselect();
 
-			ScenePrimitive *bg;
+			UIRect *bg;
 			SceneLabel *label;
 
 			std::vector<UIMenuBarEntryItem> items;
@@ -82,7 +82,7 @@ namespace Polycode {
 			bool holdingMouse;
 
 			String selectedItem;
-			ScenePrimitive *bgShape;
+			UIRect *bgShape;
 			std::vector<UIMenuBarEntry*> entries;
 			UIMenuBarEntry *currentEntry;
 	};

+ 5 - 5
Modules/Contents/UI/Include/PolyUITextInput.h

@@ -427,9 +427,9 @@ namespace Polycode {
 			std::vector<TextColorPair> makeWordWrapBuffer(LineInfo *lineInfo, String indentPrefix);
 			std::vector<TextColorPair> splitTokens(String stringToSplit, LineColorInfo *stringColorInfo);
 			
-			ScenePrimitive *selectorRectTop;
-			ScenePrimitive *selectorRectMiddle;
-			ScenePrimitive *selectorRectBottom;		
+			UIRect *selectorRectTop;
+			UIRect *selectorRectMiddle;
+			UIRect *selectorRectBottom;		
 			int numLines;			
 			
 			Number padding;
@@ -440,7 +440,7 @@ namespace Polycode {
 			int selectionL;
 			int selectionR;
 			
-			ScenePrimitive *lineNumberBg;
+			UIRect *lineNumberBg;
 			
 			int decoratorOffset;
 		
@@ -488,7 +488,7 @@ namespace Polycode {
 			bool multiLine;
 			Timer *blinkTimer;
 			UIBox *inputRect;
-			ScenePrimitive *blinkerRect;
+			UIRect *blinkerRect;
 			Vector2 dragMouseStart;
 			
 			Color selectionColor;

+ 1 - 2
Modules/Contents/UI/Include/PolyUITree.h

@@ -93,8 +93,7 @@ namespace Polycode {
 			UITree *parent;
 			Number padding;
 			UIBox *selection;
-		//	UIBox *bgBox;
-			ScenePrimitive *bgBox;
+			UIRect *bgBox;
 			SceneLabel *textLabel;
 			SceneImage *iconImage;
 			bool selected;

+ 2 - 2
Modules/Contents/UI/Include/PolyUIVSizer.h

@@ -58,8 +58,8 @@ namespace Polycode {
 			Number baseMouseY;
 			Number baseMainHeight;
 			
-			ScenePrimitive *separatorHitShape;
-			ScenePrimitive *separatorBgShape;
+			UIRect *separatorHitShape;
+			UIRect *separatorBgShape;
 			
 			UIElement *firstElement;
 			UIElement *secondElement;			

+ 1 - 1
Modules/Contents/UI/Include/PolyUIWindow.h

@@ -70,7 +70,7 @@ namespace Polycode {
 			Tween *windowTween;
 			UIImageButton *closeBtn;
 			UIBox *windowRect;
-			ScenePrimitive *titlebarRect;
+			UIRect *titlebarRect;
 		
 			bool tweenClosing;
 			void resetTween();

+ 46 - 58
Modules/Contents/UI/Source/PolyUIBox.cpp

@@ -25,111 +25,99 @@
 using namespace Polycode;
 
 UIBox::UIBox(String imageFile, Number t, Number r, Number b, Number l, Number boxWidth, Number boxHeight) : UIElement() {
-	
+
 	setAnchorPoint(-1.0, -1.0, 0.0);	
 	
 	setWidth(boxWidth);
 	setHeight(boxHeight);
 	
-	tlImage = new SceneImage(imageFile);
-	tlImage->setAnchorPoint(-1.0, -1.0, 0.0);
+	tlImage = new UIRect(imageFile);
 	tlImage->setImageCoordinates(0,0,l,t);
 	addChild(tlImage);
 	tlImage->setPosition(0, 0);
-	tlImage->depthTest = false;
-	tlImage->depthWrite = false;	
-	
-	trImage = new SceneImage(imageFile);
-	trImage->setAnchorPoint(-1.0, -1.0, 0.0);
+
+	trImage = new UIRect(imageFile);
 	trImage->setImageCoordinates(trImage->getWidth()-r,0,r,t);
 	addChild(trImage);	
 	trImage->setPosition(boxWidth-r, 0);
-	trImage->depthTest = false;
-	trImage->depthWrite = false;	
-
 
-	blImage = new SceneImage(imageFile);
-	blImage->setAnchorPoint(-1.0, -1.0, 0.0);	
+	blImage = new UIRect(imageFile);
 	blImage->setImageCoordinates(0,blImage->getHeight()-b,l,b);
 	addChild(blImage);	
 	blImage->setPosition(0, boxHeight-b);
-	blImage->depthTest = false;
-	blImage->depthWrite = false;	
 
-	brImage = new SceneImage(imageFile);
-	brImage->setAnchorPoint(-1.0, -1.0, 0.0);
+	brImage = new UIRect(imageFile);
 	brImage->setImageCoordinates(brImage->getWidth()-r,brImage->getHeight()-b,r,b);
 	addChild(brImage);	
 	brImage->setPosition(boxWidth-r, boxHeight-b);	
-	brImage->depthTest = false;
-	brImage->depthWrite = false;	
-	
-	centerImage = new SceneImage(imageFile);
-	centerImage->setAnchorPoint(-1.0, -1.0, 0.0);
-	centerImage->setImageCoordinates(l,t,centerImage->getWidth()-l-r, centerImage->getHeight()-t-b, boxWidth-l-r, boxHeight-t-b);
+
+	centerImage = new UIRect(imageFile);
+	centerImage->setImageCoordinates(l,t,centerImage->getWidth()-l-r, centerImage->getHeight()-t-b);
 	addChild(centerImage);	
 	centerImage->setPosition(l,t);	
-	centerImage->depthTest = false;
-	centerImage->depthWrite = false;	
-	
-	tImage = new SceneImage(imageFile);
-	tImage->setAnchorPoint(-1.0, -1.0, 0.0);
-	tImage->setImageCoordinates(l,0,tImage->getWidth()-l-r,t, boxWidth-l-r, t);
+	centerImage->Resize(boxWidth-l-r, boxHeight-t-b);
+
+	tImage = new UIRect(imageFile);
+	tImage->setImageCoordinates(l,0,tImage->getWidth()-l-r,t);
 	addChild(tImage);
 	tImage->setPosition(l,0);	
-	tImage->depthTest = false;
-	tImage->depthWrite = false;	
+	tImage->Resize(boxWidth-l-r, t);
 
-	bImage = new SceneImage(imageFile);
-	bImage->setAnchorPoint(-1.0, -1.0, 0.0);	
-	bImage->setImageCoordinates(l,bImage->getHeight()-b,bImage->getWidth()-l-r,b, boxWidth-l-r, b);
+	bImage = new UIRect(imageFile);
+	bImage->setImageCoordinates(l,bImage->getHeight()-b,bImage->getWidth()-l-r,b);
 	addChild(bImage);
 	bImage->setPosition(l,boxHeight-b);	
-	bImage->depthTest = false;
-	bImage->depthWrite = false;	
+	bImage->Resize(boxWidth-l-r, b);
 
-	lImage = new SceneImage(imageFile);
-	lImage->setAnchorPoint(-1.0, -1.0, 0.0);		
-	lImage->setImageCoordinates(0,t,l,lImage->getHeight()-t-b, l, boxHeight-t-b);
+	lImage = new UIRect(imageFile);
+	lImage->setImageCoordinates(0,t,l,lImage->getHeight()-t-b);
 	addChild(lImage);
 	lImage->setPosition(0,t);	
-	lImage->depthTest = false;
-	lImage->depthWrite = false;	
+	lImage->Resize(l, boxHeight-t-b);
 
-	rImage = new SceneImage(imageFile);
-	rImage->setAnchorPoint(-1.0, -1.0, 0.0);		
-	rImage->setImageCoordinates(rImage->getWidth()-r,t,r,rImage->getHeight()-t-b, r, boxHeight-t-b);
+	rImage = new UIRect(imageFile);
+	rImage->setImageCoordinates(rImage->getWidth()-r,t,r,rImage->getHeight()-t-b);
 	addChild(rImage);
 	rImage->setPosition(boxWidth-r,t);	
-	rImage->depthTest = false;
-	rImage->depthWrite = false;	
+	rImage->Resize(r, boxHeight-t-b);	
 	
 	this->t = t;
 	this->r = r;
 	this->b = b;
 	this->l = l;
-	
+/*	
+	tlImage->setColor(1.0, 0.0, 0.0, 1.0);
+	trImage->setColor(0.0, 1.0, 0.0, 1.0);		
+	blImage->setColor(0.0, 0.0, 1.0, 1.0);
+	brImage->setColor(1.0, 1.0, 0.0, 1.0);
+	centerImage->setColor(0.0, 1.0, 1.0, 1.0);
+	tImage->setColor(1.0, 0.0, 1.0, 1.0);
+	rImage->setColor(1.0, 0.5, 0.5, 1.0);
+	bImage->setColor(0.5, 1.0, 0.5, 1.0);
+	lImage->setColor(0.5, 0.5, 1.0, 1.0);
+*/	
 	ownsChildren = true;	
 }
 
 void UIBox::resizeBox(Number newWidth, Number newHeight) {
 
-	setWidth(newWidth);
-	setHeight(newHeight);
-
 	brImage->setPosition(newWidth-brImage->getWidth(), newHeight-brImage->getHeight());
 	trImage->setPosition(newWidth-trImage->getWidth(), 0);
 	blImage->setPosition(0, newHeight-blImage->getHeight());
-	
-	centerImage->setImageCoordinates(l,t,centerImage->getImageWidth()-l-r, centerImage->getImageHeight()-t-b, newWidth-l-r, newHeight-t-b);
-	lImage->setImageCoordinates(0,t,l,lImage->getImageHeight()-t-b, l, newHeight-t-b);
-	rImage->setImageCoordinates(rImage->getImageWidth()-r,t,r,rImage->getImageHeight()-t-b, r, newHeight-t-b);
-	bImage->setImageCoordinates(l,bImage->getImageHeight()-b,bImage->getImageWidth()-l-r,b, newWidth-l-r, b);
-	tImage->setImageCoordinates(l,0,tImage->getImageWidth()-l-r,t, newWidth-l-r, t);	
-	
+
+	centerImage->Resize(newWidth-l-r, newHeight-t-b);
+
+	lImage->Resize(l, newHeight-t-b);	
+	rImage->Resize(r, newHeight-t-b);		
+	bImage->Resize(newWidth-l-r, b);
+	tImage->Resize(newWidth-l-r, t);	
+
 	bImage->setPosition(bImage->getPosition().x, newHeight-bImage->getHeight());	
 	rImage->setPosition(newWidth-rImage->getWidth(),rImage->getPosition().y);
-		
+
+	setWidth(newWidth);
+	setHeight(newHeight);
+
 	this->rebuildTransformMatrix();
 }
 

+ 2 - 2
Modules/Contents/UI/Source/PolyUIColorBox.cpp

@@ -447,7 +447,7 @@ UIColorBox::UIColorBox(UIColorPicker *colorPicker, Color initialColor, Number wi
 	Number sl = conf->getNumericValue("Polycode", "uiColorBoxFrameImageL");
 
 
-	bgImage = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width-(frameInset*2), height-(frameInset*2));
+	bgImage = new UIRect(width-(frameInset*2), height-(frameInset*2));
 	bgImage->setAnchorPoint(-1.0, -1.0, 0.0);
 	bgImage->loadTexture(bgImageFile);
 	bgImage->setPosition(frameInset, frameInset);	
@@ -456,7 +456,7 @@ UIColorBox::UIColorBox(UIColorPicker *colorPicker, Color initialColor, Number wi
 	bgImage->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	bgImage->processInputEvents = true;
 
-	colorShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width-(frameInset*2), height-(frameInset*2));
+	colorShape = new UIRect(width-(frameInset*2), height-(frameInset*2));
 	colorShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	colorShape->setPosition(frameInset, frameInset);
 	addChild(colorShape);

+ 137 - 0
Modules/Contents/UI/Source/PolyUIElement.cpp

@@ -21,11 +21,148 @@
  */
 
 #include "PolyUIElement.h"
+#include "PolyRenderer.h"
+#include "PolyCoreServices.h"
+#include "PolyTexture.h"
 
 using namespace Polycode;
 
 UIElement *UIElement::globalFocusedChild = NULL;
 
+UIRect::UIRect(String fileName) : UIElement() {
+	texture = NULL;
+	loadTexture(fileName);
+	if(texture) {	
+		initRect(texture->getWidth(), texture->getHeight());
+		imageWidth = texture->getWidth();
+		imageHeight = texture->getHeight();	
+	} else {
+		initRect(1,  1);
+		imageWidth = 0;
+		imageHeight = 0;
+	}
+}
+
+UIRect::UIRect(Number width, Number height) : UIElement() {
+	texture = NULL;
+	initRect(width, height);
+	imageWidth = 0;
+	imageHeight = 0;
+}
+
+void UIRect::setImageCoordinates(Number x, Number y, Number width, Number height) {
+	Vertex *vertex;
+	Number pixelSizeX = 1/imageWidth;
+	Number pixelSizeY = 1/imageHeight;
+
+	setWidth(width);
+	setHeight(height);
+
+	Number whalf = width/2.0f;
+	Number hhalf = height/2.0f;
+		
+	Number xFloat = x * pixelSizeX;
+	Number yFloat = (y * pixelSizeY);
+	Number wFloat = width * pixelSizeX;
+	Number hFloat = height * pixelSizeY;
+
+	Polygon *imagePolygon = rectMesh->getPolygon(0);	
+	vertex = imagePolygon->getVertex(0);
+	vertex->set(-whalf,-hhalf,0);
+	vertex->setTexCoord(xFloat, yFloat + hFloat);
+
+	vertex = imagePolygon->getVertex(1);
+	vertex->set(-whalf+width,-hhalf,0);
+	vertex->setTexCoord(xFloat + wFloat, yFloat + hFloat);
+
+	vertex = imagePolygon->getVertex(2);
+	vertex->set(-whalf+width,-hhalf+height,0);
+	vertex->setTexCoord(xFloat + wFloat, yFloat);
+
+	vertex = imagePolygon->getVertex(3);	
+	vertex->set(-whalf,-hhalf+height,0);	
+	vertex->setTexCoord(xFloat, yFloat);
+
+	rectMesh->arrayDirtyMap[RenderDataArray::VERTEX_DATA_ARRAY] = true;
+	rectMesh->arrayDirtyMap[RenderDataArray::TEXCOORD_DATA_ARRAY] = true;	
+	rebuildTransformMatrix();
+	matrixDirty = true;
+}
+
+Number UIRect::getImageWidth() const {
+	return imageWidth;
+}
+
+Number UIRect::getImageHeight() const {
+	return imageHeight;	
+}
+
+void UIRect::initRect(Number width, Number height) {
+	rectMesh = new Mesh(Mesh::QUAD_MESH);
+	processInputEvents = true;
+
+	setAnchorPoint(-1.0, -1.0, 0.0);
+	setWidth(width);	
+	setHeight(height);
+	
+	Number whalf = width/2.0f;
+	Number hhalf = height/2.0f;
+						
+	Polygon *poly = new Polygon();
+	poly->addVertex(-whalf,-hhalf,0,0,0);
+	poly->addVertex(-whalf+width,-hhalf,0, 1, 0);
+	poly->addVertex(-whalf+width,-hhalf+height,0, 1, 1);
+	poly->addVertex(-whalf,-hhalf+height,0,0,1);
+	rectMesh->addPolygon(poly);
+}
+
+UIRect::~UIRect() {
+	delete rectMesh;
+}
+
+void UIRect::loadTexture(String fileName) {
+	MaterialManager *materialManager = CoreServices::getInstance()->getMaterialManager();
+	texture = materialManager->createTextureFromFile(fileName, materialManager->clampDefault, false);
+}
+
+void UIRect::setTexture(Texture *texture) {
+	this->texture = texture;
+}	
+
+Texture *UIRect::getTexture() {
+	return texture;
+}
+
+void UIRect::Render() {
+	renderer->clearShader();
+	renderer->setTexture(texture);
+	renderer->pushDataArrayForMesh(rectMesh, RenderDataArray::VERTEX_DATA_ARRAY);
+	renderer->pushDataArrayForMesh(rectMesh, RenderDataArray::TEXCOORD_DATA_ARRAY);	
+	renderer->drawArrays(Mesh::QUAD_MESH);
+}
+
+void UIRect::Resize(Number width, Number height) {
+
+	setWidth(width);	
+	setHeight(height);
+
+	Number whalf = width/2.0f;
+	Number hhalf = height/2.0f;
+	Polygon *polygon;
+	Vertex *vertex;
+
+	polygon = rectMesh->getPolygon(0);	
+	vertex = polygon->getVertex(0);
+	vertex->set(-whalf,-hhalf,0);			
+	vertex = polygon->getVertex(1);
+	vertex->set(-whalf+width,-hhalf,0);			
+	vertex = polygon->getVertex(2);
+	vertex->set(-whalf+width,-hhalf+height,0);			
+	vertex = polygon->getVertex(3);	
+	vertex->set(-whalf,-hhalf+height,0);				
+	rectMesh->arrayDirtyMap[RenderDataArray::VERTEX_DATA_ARRAY] = true;	
+}
+
 UIImage::UIImage(String imagePath) : UIElement() {
 	image = new SceneImage(imagePath);
 	image->setAnchorPoint(-1.0, -1.0, 0.0);

+ 1 - 1
Modules/Contents/UI/Source/PolyUIFileDialog.cpp

@@ -13,7 +13,7 @@ UIFileDialogEntry::UIFileDialogEntry(OSFileEntry entry, bool canSelect, int widt
 	String folderIconName = conf->getStringValue("Polycode", "uiFileBrowserFolderIcon");
 	String placeIconName = conf->getStringValue("Polycode", "uiFileBrowserPlaceIcon");
 
-	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width, 18);
+	bg = new UIRect(width, 18);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bg);
 	bg->setColor(0.0, 0.0, 0.0, 0.1);

+ 6 - 6
Modules/Contents/UI/Source/PolyUIHSizer.cpp

@@ -36,7 +36,7 @@ UIHSizer::UIHSizer(Number width, Number height, Number mainWidth, bool leftSizer
 	this->leftSizer = leftSizer;
 	this->mainWidth = mainWidth;
 	
-	separatorBgShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1,height);
+	separatorBgShape = new UIRect(1,height);
 	separatorBgShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	separatorBgShape->setColor(0.0, 0.0, 0.0, 1.0);	
 	addChild(separatorBgShape);
@@ -49,7 +49,7 @@ UIHSizer::UIHSizer(Number width, Number height, Number mainWidth, bool leftSizer
 	firstElement = NULL;
 	secondElement = NULL;
 	
-	separatorHitShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 8,height);
+	separatorHitShape = new UIRect(8,height);
 	separatorHitShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	separatorHitShape->setColor(1.0, 0.0, 0.0, 0.5);	
 	separatorHitShape->blockMouseInput = true;	
@@ -167,9 +167,9 @@ void UIHSizer::updateSizer() {
 			secondElement->Resize(getWidth()-mainWidth-1, getHeight());	
 		}
 
-		separatorBgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 1, getHeight());
+		separatorBgShape->Resize(1, getHeight());
 		separatorBgShape->setPosition(mainWidth,0);
-		separatorHitShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 8, getHeight());
+		separatorHitShape->Resize(8, getHeight());
 		separatorHitShape->setPosition(mainWidth-4,0);
 		
 	} else {
@@ -183,9 +183,9 @@ void UIHSizer::updateSizer() {
 			secondElement->Resize(mainWidth-1, getHeight());	
 		}
 
-		separatorBgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 1, getHeight());
+		separatorBgShape->Resize(1, getHeight());
 		separatorBgShape->setPosition(getWidth()-mainWidth,0);
-		separatorHitShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 8, getHeight());
+		separatorHitShape->Resize(8, getHeight());
 		separatorHitShape->setPosition(getWidth()-mainWidth-4,0);
 	
 	}

+ 2 - 2
Modules/Contents/UI/Source/PolyUIHSlider.cpp

@@ -56,7 +56,7 @@ UIHSlider::UIHSlider(Number start, Number end, Number width) : UIElement() {
 	gripRect->getImage()->setAnchorPoint(0.0, 0.0, 0.0);
 	gripRect->setPosition(0, floor(bgHeight/2.0));
 
-	bgHitBox = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width, gripRect->getHeight());
+	bgHitBox = new UIRect(width, gripRect->getHeight());
 	bgHitBox->setAnchorPoint(-1.0, -1.0, 0.0);
 	bgHitBox->setPosition(0, gripRect->getPosition().y - (gripRect->getHeight()/2.0));
 	addChild(bgHitBox);
@@ -115,7 +115,7 @@ void UIHSlider::Resize(Number width, Number height) {
 	sliderWidth = width;
 	gripRect->setDragLimits(Rectangle(0,floor(bgHeight/2.0),width,0));	
 	setSliderValue(sliderValue);
-	bgHitBox->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width,  gripRect->getHeight());
+	bgHitBox->Resize(width,  gripRect->getHeight());
 }
 			
 void UIHSlider::handleEvent(Event *event) {

+ 1 - 1
Modules/Contents/UI/Source/PolyUIImageButton.cpp

@@ -36,7 +36,7 @@ UIImageButton::UIImageButton(String imageName) : UIElement() {
 	buttonImage->depthTest = false;
 	buttonImage->setAnchorPoint(-1.0, -1.0, 0.0);
 	
-	buttonRect = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, buttonImage->getWidth(),buttonImage->getHeight(),0,0);
+	buttonRect = new UIRect(buttonImage->getWidth(),buttonImage->getHeight());
 	buttonRect->setColor(1,1,1,0);
 	buttonRect->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(buttonRect);

+ 3 - 3
Modules/Contents/UI/Source/PolyUIMenuBar.cpp

@@ -39,7 +39,7 @@ UIMenuBarEntry::UIMenuBarEntry(String name): UIElement() {
 	
 	label = new SceneLabel(name, 14, "sans");
 	setWidth(label->getLabel()->getTextWidth() + 20);
-	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, getWidth(), 25);
+	bg = new UIRect(getWidth(), 25);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bg);
 	bg->color.setColorHex(0xce5a1600);
@@ -69,7 +69,7 @@ UIMenuBar::UIMenuBar(int width, UIGlobalMenu *globalMenu) : UIElement() {
 
 	this->globalMenu = globalMenu;
 
-	bgShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width, 25);
+	bgShape = new UIRect(width, 25);
 	addChild(bgShape);
 	bgShape->setColor(0.0, 0.0, 0.0, 1.0);
 	bgShape->setAnchorPoint(-1.0, -1.0, 0.0);
@@ -178,5 +178,5 @@ UIMenuBar::~UIMenuBar() {
 }
 
 void UIMenuBar::Resize(Number width, Number height) {
-	bgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 25);
+	bgShape->Resize(width, 25);
 }

+ 14 - 14
Modules/Contents/UI/Source/PolyUITextInput.cpp

@@ -116,7 +116,7 @@ UITextInput::UITextInput(bool multiLine, Number width, Number height) : UIElemen
 	addChild(inputRect);		
 	
 	if(multiLine) {
-		lineNumberBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1,1);
+		lineNumberBg = new UIRect(1,1);
 		lineNumberBg->setAnchorPoint(-1.0, -1.0, 0.0);
 		lineNumberBg->setColor(0.0, 0.0, 0.0, 0.3);
 		addChild(lineNumberBg);
@@ -147,26 +147,26 @@ UITextInput::UITextInput(bool multiLine, Number width, Number height) : UIElemen
 	
 	selectionColor = Color(181.0f/255.0f, 213.0f/255.0f, 255.0f/255.0f, 1.0f);
 	
-	selectorRectTop = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1,1);
+	selectorRectTop = new UIRect(1,1);
 //	selectorRectTop->setAnchorPoint(-1.0, -1.0, 0.0);
 	selectorRectTop->setColor(181.0f/255.0f, 213.0f/255.0f, 255.0f/255.0f, 1);
 	selectorRectTop->visible = false;
 	textContainer->addChild(selectorRectTop);
 
-	selectorRectMiddle = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1,1);
+	selectorRectMiddle = new UIRect(1,1);
 //	selectorRectMiddle->setAnchorPoint(-1.0, -1.0, 0.0);	
 	selectorRectMiddle->setColor(181.0f/255.0f, 213.0f/255.0f, 255.0f/255.0f, 1);
 	selectorRectMiddle->visible = false;
 	textContainer->addChild(selectorRectMiddle);
 
-	selectorRectBottom = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1,1);
+	selectorRectBottom = new UIRect(1,1);
 //	selectorRectBottom->setAnchorPoint(-1.0, -1.0, 0.0);	
 	selectorRectBottom->setColor(181.0f/255.0f, 213.0f/255.0f, 255.0f/255.0f, 1);
 	selectorRectBottom->visible = false;
 	textContainer->addChild(selectorRectBottom);
 		
 	
-	blinkerRect = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, fontSize+2,0,0);
+	blinkerRect = new UIRect(1, fontSize+2);
 	blinkerRect->setAnchorPoint(-1.0, -1.0, 0.0);
 	blinkerRect->setColor(0,0,0,1);
 	textContainer->addChild(blinkerRect);
@@ -361,8 +361,8 @@ void UITextInput::updateSelectionRects() {
 	if(topSize < 4) {
 		topSize = 4;
 	}
-	selectorRectTop->setScale(topSize, topHeight);
-	selectorRectTop->setPosition(topX + (topSize/2.0) - horizontalPixelScroll, lineStart * (lineHeight+lineSpacing) + (topHeight/2.0));
+	selectorRectTop->Resize(topSize, topHeight);
+	selectorRectTop->setPosition(topX - horizontalPixelScroll, lineStart * (lineHeight+lineSpacing));
 	
 	if(lineEnd > lineStart && lineEnd < wordWrapLines.size()) {
 		String bottomLine = wordWrapLines[lineEnd].text;
@@ -376,8 +376,8 @@ void UITextInput::updateSelectionRects() {
 			bottomSize = 4;
 		}
 
-		selectorRectBottom->setScale(bottomSize, bottomHeight);
-		selectorRectBottom->setPosition(bottomSize/2.0 - horizontalPixelScroll, lineEnd * (lineHeight+lineSpacing) + (bottomHeight/2.0));
+		selectorRectBottom->Resize(bottomSize, bottomHeight);
+		selectorRectBottom->setPosition(-horizontalPixelScroll, lineEnd * (lineHeight+lineSpacing));
 		
 		if(lineEnd != lineStart+1) {
 			// need filler
@@ -387,8 +387,8 @@ void UITextInput::updateSelectionRects() {
 			for(int i=lineStart+1; i < lineEnd;i++) {
 				midHeight += lineHeight+lineSpacing;
 			}
-			selectorRectMiddle->setScale(midSize, midHeight);
-			selectorRectMiddle->setPosition(midSize/2.0 - horizontalPixelScroll, ((lineStart+1) * (lineHeight+lineSpacing)) + (midHeight/2.0));										
+			selectorRectMiddle->Resize(midSize, midHeight);
+			selectorRectMiddle->setPosition(- horizontalPixelScroll, ((lineStart+1) * (lineHeight+lineSpacing)));	
 			
 		}
 		
@@ -683,7 +683,7 @@ void UITextInput::doMultilineResize() {
 		restructLines();		
 		readjustBuffer();
 		if(lineNumbersEnabled) {
-			lineNumberBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, decoratorOffset, getHeight());
+			lineNumberBg->Resize(decoratorOffset, getHeight());
 		}
 	}
 	
@@ -713,7 +713,7 @@ void UITextInput::Resize(Number width, Number height) {
 		renumberLines();
 		readjustBuffer();
 		if(lineNumbersEnabled) {
-			lineNumberBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, decoratorOffset, height);
+			lineNumberBg->Resize(decoratorOffset, height);
 		}		
 	}
 	
@@ -848,7 +848,7 @@ void UITextInput::restructLines() {
 	}
 	
 	if(multiLine && lineNumbersEnabled) {
-		lineNumberBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, decoratorOffset, getHeight());
+		lineNumberBg->Resize(decoratorOffset, getHeight());
 	}
 	
 	if(scrollContainer) {

+ 2 - 2
Modules/Contents/UI/Source/PolyUITree.cpp

@@ -55,7 +55,7 @@ UITree::UITree(String icon, String text, Number treeWidth, Number treeOffset) :
 								Label::ANTIALIAS_FULL);
 	textLabel->color.setColorHexFromString(conf->getStringValue("Polycode", "uiTreeFontColor"));
 	
-	bgBox = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, treeWidth, cellHeight);	
+	bgBox = new UIRect(treeWidth, cellHeight);	
 	bgBox->setAnchorPoint(-1.0, -1.0, 0.0);
 	bgBox->setPosition(-treeOffset,0);	
 	bgBox->setColor(1, 1, 1, 0);
@@ -113,7 +113,7 @@ UITree::UITree(String icon, String text, Number treeWidth, Number treeOffset) :
 void UITree::Resize(Number width) {
 	treeWidth = width;
 	selection->resizeBox(treeWidth+(padding*2), cellHeight+(padding*2));
-	bgBox->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, cellHeight);
+	bgBox->Resize(width, cellHeight);
 	
 	for(int i=0; i < treeChildren.size(); i++) {
 		treeChildren[i]->Resize(width);

+ 6 - 6
Modules/Contents/UI/Source/PolyUIVSizer.cpp

@@ -37,7 +37,7 @@ UIVSizer::UIVSizer(Number width, Number height, Number mainHeight, bool topSizer
 	this->topSizer = topSizer;
 	this->mainHeight = mainHeight;
 	
-	separatorBgShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width,1);
+	separatorBgShape = new UIRect(width,1);
 	separatorBgShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	separatorBgShape->setColor(0.0, 0.0, 0.0, 1.0);	
 	addChild(separatorBgShape);
@@ -49,7 +49,7 @@ UIVSizer::UIVSizer(Number width, Number height, Number mainHeight, bool topSizer
 	firstElement = NULL;
 	secondElement = NULL;
 	
-	separatorHitShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width,8);
+	separatorHitShape = new UIRect(width,8);
 	separatorHitShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	separatorHitShape->setColor(1.0, 0.0, 0.0, 0.5);	
 	addChild(separatorHitShape);
@@ -172,9 +172,9 @@ void UIVSizer::updateSizer() {
 			secondElement->Resize(getWidth(), getHeight()-mainHeight-1);				
 		}
 
-		separatorBgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), 1);
+		separatorBgShape->Resize(getWidth(), 1);
 		separatorBgShape->setPosition(0,mainHeight);
-		separatorHitShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), 8);
+		separatorHitShape->Resize(getWidth(), 8);
 		separatorHitShape->setPosition(0, mainHeight-4);
 		
 	} else {
@@ -189,9 +189,9 @@ void UIVSizer::updateSizer() {
 			secondElement->Resize(getWidth(), mainHeight-1);	
 		}
 
-		separatorBgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), 1);
+		separatorBgShape->Resize(getWidth(), 1);
 		separatorBgShape->setPosition(0,getHeight()-mainHeight);
-		separatorHitShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), 8);
+		separatorHitShape->Resize(getWidth(), 8);
 		separatorHitShape->setPosition(0, getHeight()-mainHeight-4);
 
 	}	

+ 1 - 1
Modules/Contents/UI/Source/PolyUIWindow.cpp

@@ -62,7 +62,7 @@ UIWindow::UIWindow(String windowName, Number width, Number height) : UIElement()
 	Number titleBarHeight = conf->getNumericValue("Polycode", "uiWindowTitleBarHeight");
 	Number titleBarOffset = conf->getNumericValue("Polycode", "uiWindowTitleBarOffset");
 		
-	titlebarRect = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, width, titleBarHeight);
+	titlebarRect = new UIRect(width, titleBarHeight);
 	titlebarRect->setPosition(0, titleBarOffset);
 	titlebarRect->setColor(0,0,0,0);
 	titlebarRect->setAnchorPoint(-1.0, -1.0, 0.0);