Просмотр исходного кода

First pass at resolving changes in the IDE code

Ivan Safrin 12 лет назад
Родитель
Сommit
d5e2bbf406
35 измененных файлов с 570 добавлено и 563 удалено
  1. 4 4
      IDE/Contents/Include/PolycodeConsole.h
  2. 2 1
      IDE/Contents/Include/PolycodeEditor.h
  3. 7 7
      IDE/Contents/Include/PolycodeFontEditor.h
  4. 21 21
      IDE/Contents/Include/PolycodeFrame.h
  5. 7 6
      IDE/Contents/Include/PolycodeImageEditor.h
  6. 12 12
      IDE/Contents/Include/PolycodeMaterialEditor.h
  7. 1 1
      IDE/Contents/Include/PolycodeProjectBrowser.h
  8. 3 3
      IDE/Contents/Include/PolycodeProjectEditor.h
  9. 38 38
      IDE/Contents/Include/PolycodeProps.h
  10. 64 64
      IDE/Contents/Include/PolycodeScreenEditor.h
  11. 1 1
      IDE/Contents/Include/PolycodeSpriteEditor.h
  12. 1 1
      IDE/Contents/Include/PolycodeTextEditor.h
  13. 4 4
      IDE/Contents/Include/TextureBrowser.h
  14. 4 4
      IDE/Contents/Include/ToolWindows.h
  15. 3 3
      IDE/Contents/Source/ExportProjectWindow.cpp
  16. 1 1
      IDE/Contents/Source/NewFileWindow.cpp
  17. 2 2
      IDE/Contents/Source/NewProjectWindow.cpp
  18. 15 15
      IDE/Contents/Source/PolycodeConsole.cpp
  19. 1 1
      IDE/Contents/Source/PolycodeEditor.cpp
  20. 12 12
      IDE/Contents/Source/PolycodeFontEditor.cpp
  21. 32 32
      IDE/Contents/Source/PolycodeFrame.cpp
  22. 1 1
      IDE/Contents/Source/PolycodeIDEApp.cpp
  23. 21 21
      IDE/Contents/Source/PolycodeImageEditor.cpp
  24. 31 31
      IDE/Contents/Source/PolycodeMaterialEditor.cpp
  25. 5 5
      IDE/Contents/Source/PolycodeProjectBrowser.cpp
  26. 17 17
      IDE/Contents/Source/PolycodeProjectEditor.cpp
  27. 62 62
      IDE/Contents/Source/PolycodeProps.cpp
  28. 160 160
      IDE/Contents/Source/PolycodeScreenEditor.cpp
  29. 8 8
      IDE/Contents/Source/PolycodeSpriteEditor.cpp
  30. 7 7
      IDE/Contents/Source/PolycodeTextEditor.cpp
  31. 2 2
      IDE/Contents/Source/SettingsWindow.cpp
  32. 12 12
      IDE/Contents/Source/TextureBrowser.cpp
  33. 4 4
      IDE/Contents/Source/ToolWindows.cpp
  34. 1 0
      Modules/Contents/UI/Include/PolyUIElement.h
  35. 4 0
      Modules/Contents/UI/Source/PolyUIElement.cpp

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

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

+ 2 - 1
IDE/Contents/Include/PolycodeEditor.h

@@ -24,6 +24,7 @@
 
 #include "Polycode.h"
 #include "OSBasics.h"
+#include "PolyUIElement.h"
 #include "PolycodeProject.h"
 #include "PolycodeClipboard.h"
 
@@ -52,7 +53,7 @@ class PolycodeEditorAction  {
 		PolycodeEditorActionData *afterData;		
 };
 
-class PolycodeEditor : public ScreenEntity, public ClipboardProvider { 
+class PolycodeEditor : public UIElement, public ClipboardProvider { 
 public:
 	PolycodeEditor(bool _isReadOnly);
 	virtual ~PolycodeEditor();

+ 7 - 7
IDE/Contents/Include/PolycodeFontEditor.h

@@ -38,16 +38,16 @@ public:
 	
 protected:
 	
-	ScreenImage *grid;
+	UIImage *grid;
 	
 	UIBox *bg;
 	
-	ScreenEntity *anchor;
-	ScreenLabel *editorLabel;
-	ScreenLabel *editorLabel2;
-	ScreenLabel *editorLabel3;
-	ScreenLabel *editorLabel4;
-	ScreenLabel *editorLabel5;	
+	Entity *anchor;
+	SceneLabel *editorLabel;
+	SceneLabel *editorLabel2;
+	SceneLabel *editorLabel3;
+	SceneLabel *editorLabel4;
+	SceneLabel *editorLabel5;	
 };
 
 class PolycodeFontEditorFactory : public PolycodeEditorFactory {

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

@@ -39,7 +39,7 @@ using namespace Polycode;
 
 #define CURVE_SIZE 160.0
 
-class EditPoint : public ScreenEntity {
+class EditPoint : public Entity {
 	public:
 		EditPoint(BezierPoint *point, unsigned int type);
 		~EditPoint();
@@ -51,21 +51,21 @@ class EditPoint : public ScreenEntity {
 		
 		void setMode(unsigned int mode);
 
-		void limitPoint(ScreenImage *point);
+		void limitPoint(UIImage *point);
 								
-		ScreenImage *pointHandle;
+		UIImage *pointHandle;
 		
-		ScreenImage *controlHandle1;
-		ScreenImage *controlHandle2;
+		UIImage *controlHandle1;
+		UIImage *controlHandle2;
 		
-		ScreenLine *connectorLine1;
-		ScreenLine *connectorLine2;
+		SceneLine *connectorLine1;
+		SceneLine *connectorLine2;
 				
 		static const int TYPE_START_POINT = 0;		
 		static const int TYPE_POINT = 1;
 		static const int TYPE_END_POINT = 2;				
 		
-		ScreenImage *draggingPoint;
+		UIImage *draggingPoint;
 		bool dragging;
 		Vector2 basePosition;
 		Vector2 basePointPosition;
@@ -125,7 +125,7 @@ class CurveEditor : public UIWindow {
 		UIImageButton *addButton;
 		UIImageButton *removeButton;
 				
-		ScreenImage	*selectorImage;
+		UIImage	*selectorImage;
 		
 		static const int MODE_SELECT = 0;		
 		static const int MODE_ADD = 1;
@@ -134,7 +134,7 @@ class CurveEditor : public UIWindow {
 		UITreeContainer *treeContainer;
 		
 		unsigned int mode;
-		ScreenImage *bg;
+		UIImage *bg;
 		
 		EditCurve *selectedCurve;
 		std::vector<EditCurve*> curves;
@@ -151,7 +151,7 @@ class EditorHolder : public UIElement {
 		
 };
 
-class PolycodeFrame : public ScreenEntity {
+class PolycodeFrame : public Entity {
 public:
 	
 	PolycodeFrame();
@@ -195,7 +195,7 @@ public:
 	YesNoPopup *yesNoPopup;
 	YesNoCancelPopup *yesNoCancelPopup;
 	
-	ScreenEntity *welcomeEntity;	
+	Entity *welcomeEntity;	
 	PolycodeProjectBrowser *projectBrowser;
 	PolycodeEditorManager *editorManager;
 		
@@ -233,21 +233,21 @@ private:
 	bool showingConsole;
 	Number consoleSize;
 
-	ScreenShape *fileDialogBlocker;
+	ScenePrimitive *fileDialogBlocker;
 
-	ScreenShape *topBarBg;
-	ScreenImage *logo;	
-	ScreenImage *resizer;	
+	ScenePrimitive *topBarBg;
+	UIImage *logo;	
+	UIImage *resizer;	
 
 	OSFileEntry draggedFile;
-	ScreenEntity *dragEntity;
-	ScreenLabel *dragLabel;
+	Entity *dragEntity;
+	SceneLabel *dragLabel;
 	bool isDragging;
 	
-	ScreenLabel *currentProjectTitle;
+	SceneLabel *currentProjectTitle;
 	UIComboBox *currentFileSelector;
 	
-	ScreenImage *welcomeImage;	
+	UIImage *welcomeImage;	
 	
 	
 	EditorHolder *editorHolder;
@@ -255,7 +255,7 @@ private:
 
 	vector<PolycodeEditor*> editors;
 	
-	ScreenShape *modalBlocker;
+	ScenePrimitive *modalBlocker;
 	UIWindow *modalChild;		
 	
 	UIVSizer *consoleSizer;

+ 7 - 6
IDE/Contents/Include/PolycodeImageEditor.h

@@ -23,6 +23,7 @@
 #pragma once
 
 #include "PolycodeEditor.h"
+#include "PolyUIElement.h"
 #include <Polycode.h>
 
 using namespace Polycode;
@@ -36,14 +37,14 @@ class PolycodeImageEditor : public PolycodeEditor {
 	void Resize(int x, int y);
 	
 	protected:
-		ScreenImage *grid;
+		UIImage *grid;
 	
-		ScreenShape *editorImage;
+		ScenePrimitive *editorImage;
 		
-		ScreenShape *leftShape;		
-		ScreenShape *rightShape;		
-		ScreenShape *topShape;		
-		ScreenShape *bottomShape;								
+		ScenePrimitive *leftShape;		
+		ScenePrimitive *rightShape;		
+		ScenePrimitive *topShape;		
+		ScenePrimitive *bottomShape;								
 		
 		Number aspectRatio;
 };

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

@@ -60,13 +60,13 @@ class MaterialPreviewBox : public UIElement {
 		SceneLight *mainLight;
 		SceneLight *secondLight;		
 		SceneRenderTexture *renderTexture;
-		ScreenShape *previewShape;
+		ScenePrimitive *previewShape;
 		
 		std::vector<UIImageButton*> shapeSwitches;
 		std::vector<ScenePrimitive*> shapePrimitives;
-		ScreenImage *shapeSelector;
+		UIImage *shapeSelector;
 		
-		ScreenEntity *previewBase;		
+		Entity *previewBase;		
 		ScenePrimitive *previewPrimitive;	
 		Material *currentMaterial;					
 };
@@ -83,11 +83,11 @@ class PostPreviewBox : public UIElement {
 			
 		Scene *previewScene;
 		SceneRenderTexture *renderTexture;
-		ScreenShape *previewShape;				
-		ScreenEntity *previewBase;		
+		ScenePrimitive *previewShape;				
+		Entity *previewBase;		
 		ScenePrimitive *previewPrimitive;	
 		Material *currentMaterial;	
-		ScreenShape *headerBg;
+		ScenePrimitive *headerBg;
 				
 		Number spinValue;
 		
@@ -131,7 +131,7 @@ class MaterialBrowser : public UIElement {
 														
 	protected:
 	
-		ScreenShape *headerBg;
+		ScenePrimitive *headerBg;
 		UITree *shadersNode;
 		UITree *materialsNode;
 		UITree *cubemapsNode;
@@ -152,7 +152,7 @@ class CubemapEditorPane : public UIElement {
 	protected:
 	
 		PropList *propList;
-		ScreenShape *headerBg;
+		ScenePrimitive *headerBg;
 		
 		TextureProp *yPosTexture;
 		TextureProp *yNegTexture;
@@ -179,7 +179,7 @@ class PostEditorPane : public UIElement {
 		
 		protected:
 		
-		ScreenShape *headerBgBottom;
+		ScenePrimitive *headerBgBottom;
 
 		PropList *propList;				
 		PropSheet *baseProps;
@@ -228,7 +228,7 @@ class ShaderEditorPane : public UIElement {
 		bool choosingVertexProgram;
 	
 		PropList *propList;
-		ScreenShape *headerBg;
+		ScenePrimitive *headerBg;
 		
 		ComboProp *vertexProgramProp;
 		ComboProp *fragmentProgramProp;
@@ -258,7 +258,7 @@ class MaterialEditorPane : public UIElement {
 		MaterialPreviewBox *materialPreview;
 		bool changingMaterial;
 	
-		ScreenShape *headerBg;			
+		ScenePrimitive *headerBg;			
 		
 		PropList *propList;
 		
@@ -301,7 +301,7 @@ class PolycodeMaterialEditor : public PolycodeEditor {
 	String createStringValue(unsigned int type, void *value);
 	
 	protected:
-		ScreenImage *editorImage;
+		UIImage *editorImage;
 		
 		MaterialBrowser *materialBrowser;
 		UIHSizer *mainSizer;

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

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

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

@@ -39,7 +39,7 @@ class ProjectFontEntry : public UIElement {
 		void handleEvent(Event *event);
 		
 		UITextInput *fontNameInput;
-		ScreenLabel *fontFileLabel;
+		SceneLabel *fontFileLabel;
 		
 		UIImageButton *removeButton;
 		
@@ -65,7 +65,7 @@ class PolycodeProjectEditor : public PolycodeEditor {
 	
 	PolycodeProjectManager *projectManager;
 	
-	ScreenImage *grid;
+	UIImage *grid;
 
 	Object configFile;	
 	
@@ -74,7 +74,7 @@ class PolycodeProjectEditor : public PolycodeEditor {
 	UIElement *mainSettingsWindow;
 	UIElement *moduleSettingsWindow;
 	
-	ScreenShape *headerBg;
+	ScenePrimitive *headerBg;
 	
 	UIElement *fontEntryBase;	
 	std::vector<ProjectFontEntry*> fontEntries;

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

@@ -44,8 +44,8 @@ class PropProp : public UIElement {
 		virtual void setPropWidth(Number width) {}
 		
 		String propType;
-		ScreenLabel *label;
-		ScreenEntity *propContents;				
+		SceneLabel *label;
+		Entity *propContents;				
 		
 		bool suppressChangeEvent;		
 		bool settingFromData;
@@ -69,8 +69,8 @@ class Vector2Prop : public PropProp {
 		Vector2 lastData;
 		Vector2 currentData;	
 		
-		ScreenLabel *labelX;
-		ScreenLabel *labelY;		
+		SceneLabel *labelX;
+		SceneLabel *labelY;		
 };
 
 class SliderProp : public PropProp {
@@ -85,7 +85,7 @@ class SliderProp : public PropProp {
 		void setPropData(PolycodeEditorPropActionData* data);		
 				
 		UIHSlider *slider;
-		ScreenLabel *valueLabel;
+		SceneLabel *valueLabel;
 		
 		Number lastValue;
 		Number currentValue;
@@ -266,7 +266,7 @@ class SoundProp : public PropProp {
 		void setPropData(PolycodeEditorPropActionData* data);
 		
 		Sound *previewSound;
-		ScreenLabel *soundFile;		
+		SceneLabel *soundFile;		
 		UIButton *changeButton;
 		UIButton *playButton;	
 		
@@ -312,9 +312,9 @@ class TextureProp : public PropProp {
 		
 		void setPropData(PolycodeEditorPropActionData* data);
 				
-		ScreenShape *previewShape;
+		ScenePrimitive *previewShape;
 		UIButton *changeButton;
-		ScreenLabel *textureLabel;
+		SceneLabel *textureLabel;
 		
 		String lastData;
 		String currentData;
@@ -339,10 +339,10 @@ class ScreenSpriteProp : public PropProp {
 };
 
 
-class ScreenEntityInstanceProp : public PropProp {
+class EntityInstanceProp : public PropProp {
 	public:
-		ScreenEntityInstanceProp(String caption);
-		~ScreenEntityInstanceProp();
+		EntityInstanceProp(String caption);
+		~EntityInstanceProp();
 		void handleEvent(Event *event);			
 		
 		void setPropData(PolycodeEditorPropActionData* data);
@@ -350,7 +350,7 @@ class ScreenEntityInstanceProp : public PropProp {
 		void set(String fileName);
 		String get();		
 				
-		ScreenEntityInstance *previewInstance;
+		EntityInstance *previewInstance;
 		UIButton *changeButton;
 		
 		String lastData;
@@ -376,9 +376,9 @@ class PropSheet : public UIElement {
 		String type;
 		
 		Number propHeight;				
-		ScreenEntity *contents;
+		Entity *contents;
 		
-		ScreenShape *bg;
+		ScenePrimitive *bg;
 		
 		UIImageButton *collapseButton;
 		UIImageButton *expandButton;
@@ -535,7 +535,7 @@ class ShapeSheet : public PropSheet {
 		void handleEvent(Event *event);
 		void Update();
 				
-		ScreenShape *shape;
+		ScenePrimitive *shape;
 	
 		ComboProp *typeProp;
 		Vector2Prop *shapeSize;
@@ -550,18 +550,18 @@ class ShapeSheet : public PropSheet {
 		Number lastStrokeSize;
 };
 
-class ScreenLabelSheet : public PropSheet {
+class SceneLabelSheet : public PropSheet {
 	public:
-		ScreenLabelSheet();
-		~ScreenLabelSheet();
+		SceneLabelSheet();
+		~SceneLabelSheet();
 		
 		void refreshFonts();
 		
 		void handleEvent(Event *event);
 		void Update();
 				
-		ScreenLabel *label;
-		ScreenLabel *lastLabel;	
+		SceneLabel *label;
+		SceneLabel *lastLabel;	
 		
 		int lastSize;
 		String lastFont;
@@ -573,15 +573,15 @@ class ScreenLabelSheet : public PropSheet {
 };
 
 
-class ScreenImageSheet : public PropSheet {
+class UIImageSheet : public PropSheet {
 	public:
-		ScreenImageSheet();
-		~ScreenImageSheet();
+		UIImageSheet();
+		~UIImageSheet();
 		
 		void handleEvent(Event *event);
 		void Update();
 				
-		ScreenImage *image;
+		UIImage *image;
 		
 		TextureProp *texture;
 		
@@ -603,22 +603,22 @@ class ScreenSpriteSheet : public PropSheet {
 };
 
 
-class ScreenEntityInstanceSheet : public PropSheet {
+class EntityInstanceSheet : public PropSheet {
 	public:
-		ScreenEntityInstanceSheet();
-		~ScreenEntityInstanceSheet();
+		EntityInstanceSheet();
+		~EntityInstanceSheet();
 		
 		void handleEvent(Event *event);
 		void Update();
 				
-		ScreenEntityInstance *instance;
-		ScreenEntityInstanceProp *instanceProp;
+		EntityInstance *instance;
+		EntityInstanceProp *instanceProp;
 };
 
-class ScreenEntitySheet : public PropSheet {
+class EntitySheet : public PropSheet {
 	public:
-		ScreenEntitySheet();
-		~ScreenEntitySheet();
+		EntitySheet();
+		~EntitySheet();
 		
 		void handleEvent(Event *event);
 		void Update();
@@ -626,8 +626,8 @@ class ScreenEntitySheet : public PropSheet {
 		NumberProp *widthProp;
 		NumberProp *heightProp;
 		
-		ScreenEntity *entity;
-		ScreenEntity *lastEntity;
+		Entity *entity;
+		Entity *lastEntity;
 };
 
 class SoundSheet : public PropSheet {
@@ -724,7 +724,7 @@ class Transform2DSheet : public PropSheet {
 		Number lastRotation;
 		int lastPositionMode;
 		
-		ScreenEntity *entity;
+		Entity *entity;
 };
 
 class PropList : public UIElement {
@@ -742,11 +742,11 @@ class PropList : public UIElement {
 		UIScrollContainer *scrollContainer;		
 	protected:
 	
-		ScreenEntity *propContents;
+		Entity *propContents;
 	
 		std::vector<PropSheet*> props;	
-		ScreenShape *bg;
-		ScreenShape *bg2;				
+		ScenePrimitive *bg;
+		ScenePrimitive *bg2;				
 };
 
 class PolycodeEditorPropActionData : public PolycodeEditorActionData {

+ 64 - 64
IDE/Contents/Include/PolycodeScreenEditor.h

@@ -58,11 +58,11 @@ class PolycodeScreenEditorActionDataEntry {
 		PolycodeScreenEditorActionDataEntry(Vector3 vec3, Number number);	
 		PolycodeScreenEditorActionDataEntry(Vector3 vec3);
 		PolycodeScreenEditorActionDataEntry(Number number);
-		PolycodeScreenEditorActionDataEntry(ScreenEntity *entity);
+		PolycodeScreenEditorActionDataEntry(Entity *entity);
 		Vector3 vec3;
 		Number number;
-		ScreenEntity *entity;
-		ScreenEntity *parentEntity;		
+		Entity *entity;
+		Entity *parentEntity;		
 };
 
 class PolycodeScreenEditorActionData : public PolycodeEditorActionData {
@@ -87,7 +87,7 @@ class EntityTreeView : public UIElement {
 		
 		void syncNodeToEntity(UITree *node, Entity *entity);
 		
-		void setRootEntity(ScreenEntity *entity);
+		void setRootEntity(Entity *entity);
 		
 		void Refresh();
 
@@ -106,8 +106,8 @@ class EntityTreeView : public UIElement {
 	
 		UITreeContainer *treeContainer;
 			
-		ScreenShape *headerBg;		
-		ScreenShape *bg;		
+		ScenePrimitive *headerBg;		
+		ScenePrimitive *bg;		
 				
 };
 
@@ -122,16 +122,16 @@ class PropertiesSizer : public UIElement {
 };
 
 
-class ScreenEntityNameDisplay : public ScreenEntity {
+class EntityNameDisplay : public Entity {
 	public:
-		ScreenEntityNameDisplay(ScreenEntity *targetEntity);
-		~ScreenEntityNameDisplay();
+		EntityNameDisplay(Entity *targetEntity);
+		~EntityNameDisplay();
 		
 		void Update();
 		
-		ScreenLabel *label;
-		ScreenLabel *tagsLabel;		
-		ScreenEntity *targetEntity;
+		SceneLabel *label;
+		SceneLabel *tagsLabel;		
+		Entity *targetEntity;
 };
 
 class PolycodeScreenEditorMain : public UIElement {
@@ -142,32 +142,32 @@ class PolycodeScreenEditorMain : public UIElement {
 			
 		void Resize(Number width, Number height);	
 		void syncTransformToSelected();	
-		ScreenEntity *addNewLayer(String layerName);	
+		Entity *addNewLayer(String layerName);	
 		void updateCursor();		
-		void selectEntity(ScreenEntity *entity, bool doAction = true);
+		void selectEntity(Entity *entity, bool doAction = true);
 		void resetSelectedEntityTransforms();
 		void setMode(int newMode);	
 		void handleEvent(Event *event);	
 		void resizePreviewScreen();		
 		void handleDroppedFile(OSFileEntry file, Number x, Number y);		
-		bool hasSelected(ScreenEntity *entity);
+		bool hasSelected(Entity *entity);
 		
-		void deleteEntity(ScreenEntity *entity);
+		void deleteEntity(Entity *entity);
 	
-		void applyEditorOnly(ScreenEntity *entity);
-		void applyEditorOnlyChildren(ScreenEntity *entity);
-		void applyEditorProperties(ScreenEntity *entity);
+		void applyEditorOnly(Entity *entity);
+		void applyEditorOnlyChildren(Entity *entity);
+		void applyEditorProperties(Entity *entity);
 			
-		void processEventForEntity(ScreenEntity *childEntity, InputEvent *inputEvent);
+		void processEventForEntity(Entity *childEntity, InputEvent *inputEvent);
 	
 		void createParticleRef(ScreenParticleEmitter *target);
 		void createSoundRef(ScreenSound *target);
-		void createEntityRef(ScreenEntity *entity);
+		void createEntityRef(Entity *entity);
 		
 		void doAction(String actionName, PolycodeEditorActionData *data);
 		
 		void setRefVisibility(bool val);
-		void setEntityRefVisibility(ScreenEntity *entity, bool val);
+		void setEntityRefVisibility(Entity *entity, bool val);
 		
 		void getCenterAndSizeForSelected(Vector2 *center, Number *width, Number *height);
 	
@@ -179,8 +179,8 @@ class PolycodeScreenEditorMain : public UIElement {
 		
 		void adjustForSnap(Vector2 *position);
 		
-		void setCurrentLayer(ScreenEntity *newLayer, bool doAction = true);
-		ScreenEntity *getCurrentLayer();
+		void setCurrentLayer(Entity *newLayer, bool doAction = true);
+		Entity *getCurrentLayer();
 		
 		String Copy(void **data);
 		void Paste(void *data, String clipboardType);
@@ -199,50 +199,50 @@ class PolycodeScreenEditorMain : public UIElement {
 		static const int MODE_SPRITE = 10;
 		static const int MODE_PARTICLES = 11;
 																
-		std::vector<ScreenEntity*> layers;
+		std::vector<Entity*> layers;
 		
 		PropList *entityProps;
 		
-		ScreenEntity *layerBaseEntity;		
+		Entity *layerBaseEntity;		
 						
-//		ScreenEntity *selectedEntity;
-		std::vector<ScreenEntity*> selectedEntities;		
+//		Entity *selectedEntity;
+		std::vector<Entity*> selectedEntities;		
 		
 		Transform2DSheet *transform2dSheet;
 		EntitySheet *entitySheet;
 		ShapeSheet *shapeSheet;
-		ScreenImageSheet *imageSheet;
-		ScreenLabelSheet *labelSheet;
+		UIImageSheet *imageSheet;
+		SceneLabelSheet *labelSheet;
 		SoundSheet *soundSheet;
 		EntityPropSheet *entityPropSheet;
-		ScreenEntityInstanceSheet *instanceSheet;
+		EntityInstanceSheet *instanceSheet;
 		ScreenSpriteSheet *spriteSheet;
 		ScreenParticleSheet *particleSheet;
-		ScreenEntitySheet *screenEntitySheet;
+		EntitySheet *EntitySheet;
 		
 		EntityTreeView *treeView;
 		
-		ScreenEntity *objectBaseEntity;		
-		ScreenEntity *placingPreviewEntity;												
+		Entity *objectBaseEntity;		
+		Entity *placingPreviewEntity;												
 		bool multiSelect;
 		
 		PolycodeEditor *editor;	
-		ScreenEntity *baseEntity;			
+		Entity *baseEntity;			
 	protected:
 	
 		PolycodeScreenEditorActionData *beforeData;
-		ScreenEntity *currentLayer;	
+		Entity *currentLayer;	
 	
 		int gridSize;
 		bool gridSnap;
 		
 		bool pixelSnap;
 	
-		ScreenShape *previewShape;
-		ScreenImage *previewImage;
-		ScreenEntityInstance *previewInstance;		
-		ScreenLabel *previewLabel;							
-		ScreenEntity *previewEntity;
+		ScenePrimitive *previewShape;
+		UIImage *previewImage;
+		EntityInstance *previewInstance;		
+		SceneLabel *previewLabel;							
+		Entity *previewEntity;
 		ScreenParticleEmitter *previewEmitter;
 							
 		ScreenSound *previewSound;
@@ -269,8 +269,8 @@ class PolycodeScreenEditorMain : public UIElement {
 		bool zoomingMoved;
 		
 		bool parenting;
-		ScreenEntity *parentingChild;
-		ScreenLine *parentingLine;
+		Entity *parentingChild;
+		SceneLine *parentingLine;
 		
 		
 		int lastMode;
@@ -296,11 +296,11 @@ class PolycodeScreenEditorMain : public UIElement {
 		Number groupRoll;
 		Number baseAngle;
 	
-		ScreenShape *placingShape;	
+		ScenePrimitive *placingShape;	
 		Vector2 placingAnchor;
 		
-		ScreenShape *screenPreviewShape;
-		ScreenShape *sizePreviewShape;
+		ScenePrimitive *screenPreviewShape;
+		ScenePrimitive *sizePreviewShape;
 				
 		Vector2 dragOffset;
 		bool isDraggingEntity;
@@ -308,21 +308,21 @@ class PolycodeScreenEditorMain : public UIElement {
 		
 
 		
-		ScreenEntity *screenTransform;
-		ScreenShape *screenTransformShape;
-		ScreenImage *transformRotator;
+		Entity *screenTransform;
+		ScenePrimitive *screenTransformShape;
+		UIImage *transformRotator;
 
-		ScreenImage *transformScalerY;
-		ScreenImage *transformScalerX;		
-		ScreenImage *transformScalerXY;
+		UIImage *transformScalerY;
+		UIImage *transformScalerX;		
+		UIImage *transformScalerXY;
 							
-		ScreenImage *centerImage;
+		UIImage *centerImage;
 		
-		ScreenEntity *properties;
-		ScreenShape *propertiesBg;
+		Entity *properties;
+		ScenePrimitive *propertiesBg;
 
-		ScreenEntity *viewOptions;
-		ScreenShape *viewOptionsBg;
+		Entity *viewOptions;
+		ScenePrimitive *viewOptionsBg;
 		
 		UITextInput *gridSizeInput;
 		UICheckBox *gridCheckBox;
@@ -334,8 +334,8 @@ class PolycodeScreenEditorMain : public UIElement {
 		
 		UITextInput *scaleInput;
 		
-		ScreenEntity *toolPalette;
-		ScreenShape *toolPaletteBg;
+		Entity *toolPalette;
+		ScenePrimitive *toolPaletteBg;
 		
 		UIImageButton *arrowToolButton;
 		UIImageButton *shapeToolButton;
@@ -364,15 +364,15 @@ class PolycodeScreenEditorMain : public UIElement {
 						
 		Number aspects[16];
 				
-		ScreenImage *selectorImage;
+		UIImage *selectorImage;
 		int mode;	
 };
 
-class ScreenEntityClipboardData {
+class EntityClipboardData {
 	public:
-		ScreenEntityClipboardData(){}
+		EntityClipboardData(){}
 		
-		std::vector<ScreenEntity*> entities;
+		std::vector<Entity*> entities;
 };
 
 class PolycodeScreenEditor : public PolycodeEditor {
@@ -390,7 +390,7 @@ class PolycodeScreenEditor : public PolycodeEditor {
 		void Activate();		
 		
 		void saveCurveToObject(ObjectEntry *entry, BezierCurve *curve);
-		void saveEntityToObjectEntry(ScreenEntity *entity, ObjectEntry *entry);
+		void saveEntityToObjectEntry(Entity *entity, ObjectEntry *entry);
 		void saveFile();
 		
 		void doAction(String actionName, PolycodeEditorActionData *data);

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

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

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

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

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

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

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

@@ -59,9 +59,9 @@ class YesNoPopup : public UIWindow {
 		
 		String action;
 	
-		ScreenLabel *captionLabel;
+		SceneLabel *captionLabel;
 	
-		ScreenEntity *buttonAnchor;
+		Entity *buttonAnchor;
 		UIButton *cancelButton;
 		UIButton *okButton;	
 };
@@ -76,9 +76,9 @@ class YesNoCancelPopup : public UIWindow {
 		
 		String action;
 	
-		ScreenLabel *captionLabel;
+		SceneLabel *captionLabel;
 	
-		ScreenEntity *buttonAnchor;
+		Entity *buttonAnchor;
 		UIButton *cancelButton;
 		UIButton *noButton;		
 		UIButton *okButton;

+ 3 - 3
IDE/Contents/Source/ExportProjectWindow.cpp

@@ -29,7 +29,7 @@ ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 3
 
 	closeOnEscape = true;
 
-	ScreenLabel *label = new ScreenLabel("LOCATION", 22, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("LOCATION", 22, "section", Label::ANTIALIAS_FULL);
 	addChild(label);
 	label->color.a = 0.4;	
 	label->setPosition(padding, 50);
@@ -45,7 +45,7 @@ ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 3
 	locationSelectButton->setPosition(padding, projectLocationInput->getPosition().y+projectLocationInput->getHeight()+5);
 
 
-	label = new ScreenLabel("PLATFORMS", 22, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("PLATFORMS", 22, "section", Label::ANTIALIAS_FULL);
 	addChild(label);
 	label->color.a = 0.4;	
 	label->setPosition(padding, 150);
@@ -62,7 +62,7 @@ ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 3
 	addChild(linCheckBox);
 	linCheckBox->setPosition(padding, 225);
 
-	label = new ScreenLabel("OPTIONS", 22, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("OPTIONS", 22, "section", Label::ANTIALIAS_FULL);
 	addChild(label);
 	label->color.a = 0.4;	
 	label->setPosition(padding, 260);

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

@@ -56,7 +56,7 @@ NewFileWindow::NewFileWindow() : UIWindow(L"Create New File", 580, 280) {
 		}
 	}	
 	
-	ScreenLabel *label2 = new ScreenLabel(L"NEW FILE NAME (NO EXTENSION)", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label2 = new SceneLabel(L"NEW FILE NAME (NO EXTENSION)", 18, "section", Label::ANTIALIAS_FULL);
 	label2->color.a = 0.4;
 	label2->getLabel()->setColorForRange(Color(),0, 12);
 	label2->getLabel()->setColorForRange(Color(0.6, 0.6, 0.6, 1.0),12, 40);

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

@@ -64,7 +64,7 @@ NewProjectWindow::NewProjectWindow() : UIWindow(L"Create New Project", 480, 280)
 		}
 	}
 	
-	ScreenLabel *label2 = new ScreenLabel(L"PROJECT NAME", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label2 = new SceneLabel(L"PROJECT NAME", 18, "section", Label::ANTIALIAS_FULL);
 	label2->color.a = 0.4;
 	addChild(label2);
 	label2->setPosition(padding+220, templateContainer->getPosition().y-2);		
@@ -73,7 +73,7 @@ NewProjectWindow::NewProjectWindow() : UIWindow(L"Create New Project", 480, 280)
 	addChild(projectNameInput);
 	projectNameInput->setPosition(label2->getPosition().x-6, label2->getPosition().y + 25);
 	
-	ScreenLabel *label3 = new ScreenLabel(L"PROJECT LOCATION", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label3 = new SceneLabel(L"PROJECT LOCATION", 18, "section", Label::ANTIALIAS_FULL);
 	label3->color.a = 0.4;
 	addChild(label3);
 	label3->setPosition(padding+220, templateContainer->getPosition().y+65);		

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

@@ -40,15 +40,15 @@ BackTraceEntry::BackTraceEntry(String fileName, int lineNumber, PolycodeProject
 	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
 	int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize");	
 
-	labelBg = new ScreenShape(ScreenShape::SHAPE_RECT, 20,20);
-	labelBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,20);
+	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->setColor(0.0, 0.0, 0.0, 0.15);
 	labelBg->processInputEvents = true;
 	addChild(labelBg);	
 	
 	labelBg->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	
-	label = new ScreenLabel(fileName+" on line "+String::IntToString(lineNumber), fontSize, fontName);
+	label = new SceneLabel(fileName+" on line "+String::IntToString(lineNumber), fontSize, fontName);
 	addChild(label);
 	label->setPosition(5,2);
 	
@@ -84,7 +84,7 @@ BackTraceEntry::~BackTraceEntry() {
 }
 
 void BackTraceEntry::Resize(Number width, Number height) {
-	labelBg->setShapeSize(width, 20);
+	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 20);
 
 }
 
@@ -93,12 +93,12 @@ BackTraceWindow::BackTraceWindow() : UIElement() {
 	Config *conf = CoreServices::getInstance()->getConfig();	
 	String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
 
-	labelBg = new ScreenShape(ScreenShape::SHAPE_RECT, 20,30);
-	labelBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,30);
+	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(labelBg);
 	
-	ScreenLabel *label = new ScreenLabel("CRASH STACK", 18, "section");
+	SceneLabel *label = new SceneLabel("CRASH STACK", 18, "section");
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(5,3);
@@ -106,15 +106,15 @@ BackTraceWindow::BackTraceWindow() : UIElement() {
 }	
 
 void BackTraceWindow::Resize(Number width, Number height) {
-	labelBg->setShapeSize(width, 30);
-	this->width = width;
-	this->height = height;
+	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
+	setWidth(width);
+	setHeight(height);
 	adjustEntries();
 }
 
 void BackTraceWindow::adjustEntries() {
 	for(int i=0; i < entries.size(); i++) {
-		entries[i]->Resize(width, 20);
+		entries[i]->Resize(getWidth(), 20);
 		entries[i]->setPosition(0, 30 + (i * 21));
 	}
 }
@@ -167,12 +167,12 @@ BackTraceWindow::~BackTraceWindow() {
 ConsoleWindow::ConsoleWindow() : UIElement() {
 
 
-	labelBg = new ScreenShape(ScreenShape::SHAPE_RECT, 20,30);
-	labelBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	labelBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,30);
+	labelBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	labelBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(labelBg);
 	
-	ScreenLabel *label = new ScreenLabel("CONSOLE", 18, "section");
+	SceneLabel *label = new SceneLabel("CONSOLE", 18, "section");
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(35,3);
@@ -193,7 +193,7 @@ ConsoleWindow::ConsoleWindow() : UIElement() {
 
 void ConsoleWindow::Resize(Number width, Number height) {
 
-	labelBg->setShapeSize(width, 30);
+	labelBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
 	debugTextInput->Resize(width, height-25-30);
 	debugTextInput->setPosition(0, 30);
 

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

@@ -44,7 +44,7 @@ void PolycodeEditor::setFilePath(String newPath) {
 	filePath = newPath;
 }
 
-PolycodeEditor::PolycodeEditor(bool _isReadOnly) : ScreenEntity(), ClipboardProvider() {
+PolycodeEditor::PolycodeEditor(bool _isReadOnly) : UIElement(), ClipboardProvider() {
 	this->_isReadOnly = _isReadOnly;
 	enableScissor = true;	
 	processInputEvents = true;

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

@@ -41,38 +41,38 @@ bool PolycodeFontEditor::openFile(OSFileEntry filePath) {
 	
 	CoreServices::getInstance()->getFontManager()->registerFont(filePath.fullPath, filePath.fullPath);
 	
-	grid = new ScreenImage("Images/editorGrid.png");
+	grid = new UIImage("Images/editorGrid.png");
 	
 	addChild(grid);
 	grid->snapToPixels = true;
 	
-	grid->getTexture()->clamp = false;
-	grid->getTexture()->recreateFromImageData();	
+	grid->getImage()->getTexture()->clamp = false;
+	grid->getImage()->getTexture()->recreateFromImageData();	
 	
-//	bg = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+//	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	bg = new UIBox("Images/fontBox.png", 29,9,9,9, 10,10);	
-	bg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->setPosition(-50,-50);
 	
 	
-	anchor = new ScreenEntity();
+	anchor = new Entity();
 	addChild(anchor);
 	anchor->addChild(bg);
 	anchor->snapToPixels = true;
 	
-	editorLabel = new ScreenLabel(L"ABCDEFGHIJKLM", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
+	editorLabel = new SceneLabel(L"ABCDEFGHIJKLM", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
 	anchor->addChild(editorLabel);
-	editorLabel2 = new ScreenLabel(L"NOPQRSTUVWXYZ", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
+	editorLabel2 = new SceneLabel(L"NOPQRSTUVWXYZ", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
 	editorLabel2->setPosition(0, 48);
 	editorLabel->setPosition((editorLabel2->getWidth()-editorLabel->getWidth())/2, 0);
 	anchor->addChild(editorLabel2);
-	editorLabel3 = new ScreenLabel(L"abcdefghijklm", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
+	editorLabel3 = new SceneLabel(L"abcdefghijklm", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
 	editorLabel3->setPosition((editorLabel2->getWidth()-editorLabel3->getWidth())/2, 96);	
 	anchor->addChild(editorLabel3);
-	editorLabel4 = new ScreenLabel(L"nopqrstuvwxyz", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
+	editorLabel4 = new SceneLabel(L"nopqrstuvwxyz", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
 	editorLabel4->setPosition((editorLabel2->getWidth()-editorLabel4->getWidth())/2, 144);		
 	anchor->addChild(editorLabel4);
-	editorLabel5 = new ScreenLabel(L"1234567890", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
+	editorLabel5 = new SceneLabel(L"1234567890", 48, filePath.fullPath, Label::ANTIALIAS_FULL);
 	editorLabel5->setPosition((editorLabel2->getWidth()-editorLabel5->getWidth())/2, 192);			
 	anchor->addChild(editorLabel5);
 
@@ -98,7 +98,7 @@ bool PolycodeFontEditor::openFile(OSFileEntry filePath) {
 
 void PolycodeFontEditor::Resize(int x, int y) {
 	anchor->setPosition((x-anchor->getWidth()) /2, (y-anchor->getHeight()) /2);
-	grid->setImageCoordinates(0,0,x,y);
+	grid->getImage()->setImageCoordinates(0,0,x,y);
 	PolycodeEditor::Resize(x,y);	
 }
 

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

@@ -28,7 +28,7 @@ PolycodeFrame *globalFrame;
 
 extern UIGlobalMenu *globalMenu;
 
-EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
+EditPoint::EditPoint(BezierPoint *point, unsigned int type) : Entity() {
 	this->point = point;
 	this->type = type;
 	processInputEvents = true;
@@ -36,8 +36,8 @@ EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
 	draggingPoint = NULL;
 	dragging = false;
 
-	controlHandle1 = new ScreenImage("Images/bezier_handle.png");
-	controlHandle1->setPositionMode(ScreenEntity::POSITION_CENTER);
+	controlHandle1 = new UIImage("Images/bezier_handle.png");
+	controlHandle1->setAnchorPoint(0.0, 0.0, 0.0);
 	
 	controlHandle1->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	controlHandle1->addEventListener(this, InputEvent::EVENT_MOUSEUP);
@@ -48,8 +48,8 @@ EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
 		
 	addChild(controlHandle1);
 	
-	controlHandle2 = new ScreenImage("Images/bezier_handle.png");
-	controlHandle2->setPositionMode(ScreenEntity::POSITION_CENTER);
+	controlHandle2 = new UIImage("Images/bezier_handle.png");
+	controlHandle2->setAnchorPoint(0.0, 0.0, 0.0);
 	controlHandle2->processInputEvents = true;
 	
 	controlHandle2->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
@@ -61,12 +61,12 @@ EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
 	addChild(controlHandle2);
 	
 	
-	pointHandle = new ScreenImage("Images/bezier_point.png");
+	pointHandle = new UIImage("Images/bezier_point.png");
 	pointHandle->processInputEvents = true;
 	pointHandle->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	pointHandle->addEventListener(this, InputEvent::EVENT_MOUSEUP);
 	pointHandle->addEventListener(this, InputEvent::EVENT_MOUSEUP_OUTSIDE);	
-	pointHandle->setPositionMode(ScreenEntity::POSITION_CENTER);
+	pointHandle->setAnchorPoint(0.0, 0.0, 0.0);
 	pointHandle->setWidth(30);
 	pointHandle->setHeight(30);
 
@@ -76,7 +76,7 @@ EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
 		controlHandle1->enabled = false;		
 		connectorLine1 = NULL;
 	} else {
-		connectorLine1 = new ScreenLine(pointHandle, controlHandle1);
+		connectorLine1 = new SceneLine(pointHandle, controlHandle1);
 		addChild(connectorLine1);
 		connectorLine1->setColorInt(39, 212, 255, 128);
 		connectorLine1->setLineWidth(2.0);
@@ -89,7 +89,7 @@ EditPoint::EditPoint(BezierPoint *point, unsigned int type) : ScreenEntity() {
 		controlHandle2->enabled = false;		
 		connectorLine2 = NULL;
 	} else {
-		connectorLine2 = new ScreenLine(pointHandle, controlHandle2);
+		connectorLine2 = new SceneLine(pointHandle, controlHandle2);
 		addChild(connectorLine2);
 		connectorLine2->setColorInt(39, 212, 255, 128);
 		connectorLine2->setLineWidth(2.0);
@@ -161,7 +161,7 @@ void EditPoint::handleEvent(Event *event) {
 		switch(event->getEventCode()) {
 			case InputEvent::EVENT_MOUSEDOWN:
 				if(mode == CurveEditor::MODE_SELECT) {
-					draggingPoint = (ScreenImage*)event->getDispatcher();
+					draggingPoint = (UIImage*)event->getDispatcher();
 					dragging = true;
 					basePosition = CoreServices::getInstance()->getCore()->getInput()->getMousePosition(); 
 					basePointPosition = draggingPoint->getPosition2D();
@@ -186,7 +186,7 @@ void EditPoint::handleEvent(Event *event) {
 	}
 }
 
-void EditPoint::limitPoint(ScreenImage *point) {
+void EditPoint::limitPoint(UIImage *point) {
 		if(point->position.x < 0.0)
 			point->position.x = 0.0;
 		if(point->position.x > 610.0)
@@ -335,13 +335,13 @@ CurveEditor::CurveEditor() : UIWindow("", 750, 300) {
 	
 	closeOnEscape = true;
 		
-	bg = new ScreenImage("Images/curve_editor_bg.png");
+	bg = new UIImage("Images/curve_editor_bg.png");
 	addChild(bg);
 	bg->setPosition(160, 63);
 	bg->processInputEvents = true;
 	bg->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	
-	selectorImage = new ScreenImage("Images/ScreenEditor/selector.png");
+	selectorImage = new UIImage("Images/ScreenEditor/selector.png");
 	selectorImage->setColor(0.0, 0.0, 0.0, 0.3);
 	addChild(selectorImage);
 		
@@ -494,7 +494,7 @@ void EditorHolder::Resize(Number width, Number height) {
 }
 
 
-PolycodeFrame::PolycodeFrame() : ScreenEntity() {
+PolycodeFrame::PolycodeFrame() : Entity() {
 
 	globalFrame = this;
 	processInputEvents = true;
@@ -502,10 +502,10 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	showingConsole = true;
 	modalChild = NULL;
 	
-	welcomeEntity = new ScreenEntity();
+	welcomeEntity = new Entity();
 	welcomeEntity->processInputEvents = true;
 	addChild(welcomeEntity);
-	welcomeImage = new ScreenImage("Images/welcome.png");
+	welcomeImage = new UIImage("Images/welcome.png");
 	welcomeEntity->addChild(welcomeImage);
 	welcomeEntity->snapToPixels = true;
 	
@@ -540,15 +540,15 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 		
 	projectBrowser->treeContainer->getRootNode()->addEventListener(this, UITreeEvent::DRAG_START_EVENT);
 	
-	topBarBg = new ScreenShape(ScreenShape::SHAPE_RECT, 2,2);
+	topBarBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 2,2);
 	topBarBg->setColorInt(21, 18, 17, 255);
-	topBarBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	topBarBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	topBarBg->processInputEvents = true;
 	topBarBg->addEventListener(this, InputEvent::EVENT_MOUSEMOVE);
 	topBarBg->blockMouseInput = true;
 	addChild(topBarBg);
 	
-	logo = new ScreenImage("Images/barlogo.png");	
+	logo = new UIImage("Images/barlogo.png");	
 	addChild(logo);		
 	
 	
@@ -560,7 +560,7 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	addChild(stopButton);
 	stopButton->setPosition(10,4);
 
-	currentProjectTitle = new ScreenLabel("", 32, "section");
+	currentProjectTitle = new SceneLabel("", 32, "section");
 	addChild(currentProjectTitle);
 	currentProjectTitle->color.a = 0.4;
 	currentProjectTitle->setPosition(70, 0);
@@ -572,13 +572,13 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	closeFileButton = new UIImageButton("Images/remove_icon.png");
 	addChild(closeFileButton);
 	
-	resizer = new ScreenImage("Images/corner_resize.png");	
+	resizer = new UIImage("Images/corner_resize.png");	
 	addChild(resizer);
 	resizer->setColor(0,0,0,0.4);
 	
-	modalBlocker = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	modalBlocker = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	modalBlocker->setColor(0,0,0,0.4);
-	modalBlocker->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	modalBlocker->setAnchorPoint(-1.0, -1.0, 0.0);
 	modalBlocker->enabled = false;	
 	modalBlocker->blockMouseInput = true;
 	modalBlocker->processInputEvents = true;
@@ -614,7 +614,7 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	
 	aboutWindow = new UIWindow("", 800, 440);
 	aboutWindow->closeOnEscape = true;
-	ScreenImage *aboutImage = new ScreenImage("Images/about.png");
+	UIImage *aboutImage = new UIImage("Images/about.png");
 	aboutWindow->addChild(aboutImage);
 	aboutImage->setPosition(20, 40);
 	aboutWindow->visible = false;
@@ -623,16 +623,16 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	aboutOKButton->setPosition(700, 420);
 	aboutOKButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	
-	ScreenLabel *versionLabel = new ScreenLabel("version 0.8.2", 12, "mono");
+	SceneLabel *versionLabel = new SceneLabel("version 0.8.2", 12, "mono");
 	aboutWindow->addChild(versionLabel);
 	versionLabel->setPosition(20, 430);
 	versionLabel->color.a = 0.4;
 	
 	isDragging  = false;
-	dragLabel = new ScreenLabel("NONE", 11, "sans");
+	dragLabel = new SceneLabel("NONE", 11, "sans");
 	dragLabel->setPosition(0,-15);
 	
-	dragEntity = new ScreenEntity();
+	dragEntity = new Entity();
 	dragEntity->addChild(dragLabel);
 	addChild(dragEntity);
 	dragEntity->visible = false;	
@@ -656,8 +656,8 @@ PolycodeFrame::PolycodeFrame() : ScreenEntity() {
 	modalRoot = new UIElement();
 	addChild(modalRoot);
 	
-	fileDialogBlocker = new ScreenShape(ScreenShape::SHAPE_RECT, 100, 100);
-	fileDialogBlocker->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	fileDialogBlocker = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 100, 100);
+	fileDialogBlocker->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(fileDialogBlocker);
 	fileDialogBlocker->setColor(0.0, 0.0, 0.0, 0.5);
 	fileDialogBlocker->processInputEvents = true;
@@ -924,13 +924,13 @@ void PolycodeFrame::Resize(int x, int y) {
 	welcomeEntity->setPosition((x-welcomeImage->getWidth()) / 2,
 		(y-welcomeImage->getHeight()) / 2); 
 	
-	topBarBg->setShapeSize(x, 45);
+	topBarBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 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->setShapeSize(x, y);
-	fileDialogBlocker->setShapeSize(x, y);
+	modalBlocker->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, y);
+	fileDialogBlocker->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, y);
 		
 	currentFileSelector->setPosition(x-400, 11);
 	closeFileButton->setPosition(currentFileSelector->getPosition().x-20, currentFileSelector->getPosition().y+6);

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

@@ -82,7 +82,7 @@ PolycodeIDEApp::PolycodeIDEApp(PolycodeView *view) : EventDispatcher() {
 	editorManager = new PolycodeEditorManager();
 	
 	frame = new PolycodeFrame();
-	frame->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	frame->setAnchorPoint(-1.0, -1.0, 0.0);
 
 	frame->editorManager = editorManager;
 	editorManager->addEventListener(frame, Event::CHANGE_EVENT);

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

@@ -37,44 +37,44 @@ PolycodeImageEditor::~PolycodeImageEditor() {
 
 bool PolycodeImageEditor::openFile(OSFileEntry filePath) {
 	
-	grid = new ScreenImage("Images/editorGrid.png");
+	grid = new UIImage("Images/editorGrid.png");
 	
 	addChild(grid);
 	grid->snapToPixels = true;
 	
-	grid->getTexture()->clamp = false;
-	grid->getTexture()->recreateFromImageData();	
+	grid->getImage()->getTexture()->clamp = false;
+	grid->getImage()->getTexture()->recreateFromImageData();	
 		
 	
-	leftShape = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	leftShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	leftShape->setColor(0.0, 0.0, 0.0, 0.3);
-	leftShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	leftShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(leftShape);
 
-	rightShape = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	rightShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	rightShape->setColor(0.0, 0.0, 0.0, 0.3);
-	rightShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	rightShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(rightShape);
 
-	topShape = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	topShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	topShape->setColor(0.0, 0.0, 0.0, 0.3);
-	topShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	topShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(topShape);
 
-	bottomShape = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	bottomShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	bottomShape->setColor(0.0, 0.0, 0.0, 0.3);
-	bottomShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bottomShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bottomShape);
 		
 		
-	editorImage = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
+	editorImage = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
 	
 	Texture *newTexture = CoreServices::getInstance()->getMaterialManager()->createTextureFromFile(filePath.fullPath);
 	newTexture->reloadOnFileModify = true;
 	editorImage->setTexture(newTexture);
 	
-	editorImage->strokeEnabled = true;
-	editorImage->setStrokeColor(1.0, 1.0, 1.0, 0.2);
+//	editorImage->strokeEnabled = true;
+//	editorImage->setStrokeColor(1.0, 1.0, 1.0, 0.2);
 	
 	aspectRatio = ((Number)newTexture->getWidth()) / ((Number)newTexture->getHeight());
 	
@@ -86,22 +86,22 @@ bool PolycodeImageEditor::openFile(OSFileEntry filePath) {
 
 void PolycodeImageEditor::Resize(int x, int y) {
 	editorImage->setPosition(x/2, y/2);
-	grid->setImageCoordinates(0,0,x,y);	
+	grid->getImage()->setImageCoordinates(0,0,x,y);	
 	
 	if((y * 0.8) * aspectRatio > x * 0.8) {
-		editorImage->setShapeSize((x * 0.8), (x * 0.8) / aspectRatio);	
+		editorImage->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x * 0.8), (x * 0.8) / aspectRatio);	
 	} else {
-		editorImage->setShapeSize((y * 0.8) * aspectRatio, (y * 0.8));
+		editorImage->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (y * 0.8) * aspectRatio, (y * 0.8));
 	}
 	
-	leftShape->setShapeSize((x - editorImage->getWidth())/2.0, y);	
-	rightShape->setShapeSize((x - editorImage->getWidth())/2.0, y);	
+	leftShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x - editorImage->getWidth())/2.0, y);	
+	rightShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, (x - editorImage->getWidth())/2.0, y);	
 	rightShape->setPosition(leftShape->getWidth() + editorImage->getWidth(), 0);
 		
-	topShape->setShapeSize(editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
+	topShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
 	topShape->setPosition(leftShape->getWidth(),0);
 
-	bottomShape->setShapeSize(editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
+	bottomShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, editorImage->getWidth(), (y - editorImage->getHeight())/2.0);
 	bottomShape->setPosition(leftShape->getWidth(),y-bottomShape->getHeight());
 
 		

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

@@ -33,9 +33,9 @@ PostEditorPane::PostEditorPane() : UIElement() {
 	
 	bottomElement = new UIElement();
 	
-	headerBgBottom = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBgBottom = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	bottomElement->addChild(headerBgBottom);
-	headerBgBottom->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBgBottom->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBgBottom->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 	
 	propList = new PropList("POST EFFECT EDITOR");
@@ -100,7 +100,7 @@ PostEditorPane::~PostEditorPane() {
 
 void PostEditorPane::Resize(Number width, Number height) {
 	mainSizer->Resize(width, height);
-	headerBgBottom->setShapeSize(width, 30);	
+	headerBgBottom->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	propList->Resize(width/2.0, height- mainSizer->getMainHeight());
 	
 	propList->updateProps();
@@ -155,7 +155,7 @@ void PostEditorPane::handleEvent(Event *event) {
 		currentMaterial->setName(nameProp->get());
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);					
 	} else if(event->getDispatcher() == mainSizer && event->getEventCode() == UIEvent::CHANGE_EVENT) {
-			propList->Resize(propList->getWidth(), height-mainSizer->getMainHeight());
+			propList->Resize(propList->getWidth(), getHeight()-mainSizer->getMainHeight());
 			propList->updateProps();
 			adjustPreview();
 	} else if(event->getDispatcher() == passProps || event->getDispatcher() == targetBindingProps) {
@@ -189,9 +189,9 @@ void PostEditorPane::handleEvent(Event *event) {
 CubemapEditorPane::CubemapEditorPane() : UIElement() {
 	currentCubemap = NULL;
 
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 	
 	propList = new PropList("CUBEMAP EDITOR");
@@ -311,7 +311,7 @@ CubemapEditorPane::~CubemapEditorPane() {
 }
 
 void CubemapEditorPane::Resize(Number width, Number height) {
-	headerBg->setShapeSize(width, 30);	
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
@@ -322,9 +322,9 @@ ShaderEditorPane::ShaderEditorPane() : UIElement() {
 	changingShader = false;
 	currentShader = NULL;
 
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 	
 	propList = new PropList("SHADER EDITOR");
@@ -508,19 +508,19 @@ void ShaderEditorPane::setShader(Shader *shader) {
 }
 
 void ShaderEditorPane::Resize(Number width, Number height) {
-	headerBg->setShapeSize(width, 30);	
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
 
 PostPreviewBox::PostPreviewBox() : UIElement() {
 
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 
-	ScreenLabel *label = new ScreenLabel("POST PREVIEW", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("POST PREVIEW", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(10, 3);
@@ -577,13 +577,13 @@ PostPreviewBox::PostPreviewBox() : UIElement() {
 	previewScene->getDefaultCamera()->lookAt(Vector3(0.0, 0.5, 0.0));
 
 	
-	previewBase = new ScreenEntity();
+	previewBase = new Entity();
 	previewBase->processInputEvents = true;
 	previewBase->setPosition(0, 30);
 	addChild(previewBase);
 	
-	previewShape = new ScreenShape(ScreenShape::SHAPE_RECT, 256, 256);
-	previewShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);	
+	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 256, 256);
+	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);	
 	previewShape->setTexture(renderTexture->getTargetTexture());
 //	previewShape->strokeEnabled = true;
 //	previewShape->strokeColor = Color(1.0, 1.0, 1.0, 0.2);
@@ -596,7 +596,7 @@ PostPreviewBox::PostPreviewBox() : UIElement() {
 	addChild(rotateCheckBox);
 	rotateCheckBox->setPosition(150, 2);
 
-	label = new ScreenLabel("EXPOSURE", 18, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("EXPOSURE", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(270, 3);
@@ -607,7 +607,7 @@ PostPreviewBox::PostPreviewBox() : UIElement() {
 	cameraExposureInput->setText(String::NumberToString(previewScene->getDefaultCamera()->getExposureLevel()));	
 	cameraExposureInput->addEventListener(this, UIEvent::CHANGE_EVENT);
 
-	label = new ScreenLabel("LIGHT INT.", 18, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("LIGHT INT.", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(430, 3);
@@ -633,8 +633,8 @@ void PostPreviewBox::Update() {
 }
 
 void PostPreviewBox::Resize(Number width, Number height) {
-	previewShape->setShapeSize(width, height-30);
-	headerBg->setShapeSize(width, 30);
+	previewShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, height-30);
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
 	
 	int textureWidth = (int)width;
 	int textureHeight = (int) (height-30);
@@ -732,13 +732,13 @@ MaterialPreviewBox::MaterialPreviewBox() : UIElement() {
 	previewScene->getDefaultCamera()->setPosition(0,7,9);
 	previewScene->getDefaultCamera()->lookAt(Vector3());
 	
-	previewBase = new ScreenEntity();
+	previewBase = new Entity();
 	previewBase->processInputEvents = true;
 	previewBase->setPosition(0, 0);
 	addChild(previewBase);
 	
-	previewShape = new ScreenShape(ScreenShape::SHAPE_RECT, 256, 256);
-	previewShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);	
+	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 256, 256);
+	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);	
 	previewShape->setTexture(renderTexture->getTargetTexture());
 	previewShape->setPosition(20,40);
 	previewShape->strokeEnabled = true;
@@ -746,7 +746,7 @@ MaterialPreviewBox::MaterialPreviewBox() : UIElement() {
 	previewShape->setStrokeWidth(1.0);
 	previewBase->addChild(previewShape);
 	
-	shapeSelector = new ScreenImage("Images/small_selector.png");
+	shapeSelector = new UIImage("Images/small_selector.png");
 	previewBase->addChild(shapeSelector);
 	shapeSelector->color.a = 0.4;
 	
@@ -805,9 +805,9 @@ MaterialEditorPane::MaterialEditorPane() : UIElement() {
 
 	changingMaterial = false;
 	
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 	
 	propList = new PropList("MATERIAL EDITOR");
@@ -875,7 +875,7 @@ void MaterialEditorPane::reloadShaders() {
 }
 
 void MaterialEditorPane::Resize(Number width, Number height) {
-	headerBg->setShapeSize(width, 30);	
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	propList->Resize(370, height);
 	propList->updateProps();
 }
@@ -1007,9 +1007,9 @@ MaterialBrowser::MaterialBrowser() : UIElement() {
 	addChild(treeContainer);		
 	selectedData = NULL;
 	
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));	
 
 	newShaderButton = new UIImageButton("Images/new_shader.png");
@@ -1050,7 +1050,7 @@ void MaterialBrowser::handleEvent(Event *event) {
 			dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		}
 	}	
-	ScreenEntity::handleEvent(event);
+	Entity::handleEvent(event);
 }
 
 
@@ -1085,7 +1085,7 @@ MaterialBrowser::~MaterialBrowser() {
 void MaterialBrowser::Resize(Number width, Number height) {
 	treeContainer->Resize(width, height-30);
 	treeContainer->setPosition(0, 30);	
-	headerBg->setShapeSize(width, 30);	
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	removeButton->setPosition(width - 24, 8);
 }
 

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

@@ -26,12 +26,12 @@ extern UIGlobalMenu *globalMenu;
 
 PolycodeProjectBrowser::PolycodeProjectBrowser() : UIElement() {
 
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	
-	ScreenLabel *label = new ScreenLabel("PROJECT BROWSER", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("PROJECT BROWSER", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	
 	addChild(label);
@@ -144,7 +144,7 @@ void PolycodeProjectBrowser::handleEvent(Event *event) {
 		}
 	}
 	
-	ScreenEntity::handleEvent(event);
+	Entity::handleEvent(event);
 }
 
 UITree *PolycodeProjectBrowser::nodeHasName(UITree *node, String name) {
@@ -205,6 +205,6 @@ void PolycodeProjectBrowser::parseFolderIntoNode(UITree *node, String spath, Pol
 }
 
 void PolycodeProjectBrowser::Resize(Number width, Number height) {
-	headerBg->setShapeSize(width, 30);
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
 	treeContainer->Resize(width, height-30);
 }

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

@@ -56,7 +56,7 @@ ProjectFontEntry::ProjectFontEntry(String fontPath, String fontName) : UIElement
 	
 	OSFileEntry entry = OSFileEntry(fontPath, OSFileEntry::TYPE_FILE);
 	
-	fontFileLabel = new ScreenLabel(entry.name, 12);
+	fontFileLabel = new SceneLabel(entry.name, 12);
 	fontFileLabel->color.a = 0.6;
 	addChild(fontFileLabel);
 	fontFileLabel->setPosition(140, 3);
@@ -96,12 +96,12 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding");	
 		
 
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	
-	ScreenLabel *label = new ScreenLabel("PROJECT SETTINGS", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("PROJECT SETTINGS", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	
 	addChild(label);
@@ -114,7 +114,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	
 	Number lastYPos = 40;
 
-	label = new ScreenLabel("PROJECT MODULES", 18, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("PROJECT MODULES", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.a = 0.4;
 	moduleSettingsWindow->addChild(label);
 	label->setPosition(0, lastYPos);
@@ -137,7 +137,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	
 	lastYPos += 20;
 
-	label = new ScreenLabel("PROJECT FONTS", 18, "section", Label::ANTIALIAS_FULL);
+	label = new SceneLabel("PROJECT FONTS", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.a = 0.4;
 	moduleSettingsWindow->addChild(label);
 	label->setPosition(0, lastYPos);
@@ -156,13 +156,13 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	mainSettingsWindow->setPosition(0,10);
 	addChild(mainSettingsWindow);
 	
-	ScreenLabel *label2 = new ScreenLabel(L"DEFAULT VIDEO OPTIONS", 18, "section", Label::ANTIALIAS_FULL);	
+	SceneLabel *label2 = new SceneLabel(L"DEFAULT VIDEO OPTIONS", 18, "section", Label::ANTIALIAS_FULL);	
 	label2->setColor(1.0, 1.0, 1.0, 0.4);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding, 40);		
 
 		
-	label2 = new ScreenLabel(L"Width", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Width", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 6, 80);		
@@ -172,7 +172,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	defaultWidthInput->setPosition(label2->getPosition().x-6, label2->getPosition().y+18);
 	defaultWidthInput->setNumberOnly(true);
 
-	label2 = new ScreenLabel(L"Height", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Height", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 80 + 6, 80);		
@@ -182,7 +182,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	defaultHeightInput->setPosition(label2->getPosition().x-6, label2->getPosition().y+18);
 	defaultHeightInput->setNumberOnly(true);
 	
-	label2 = new ScreenLabel(L"Anti-aliasing", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Anti-aliasing", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 160 + 6, 80);		
@@ -194,7 +194,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	aaLevelComboBox->addComboItem("6x MSAA");			
 	aaLevelComboBox->setPosition(label2->getPosition().x-6, label2->getPosition().y+18);
 
-	label2 = new ScreenLabel(L"Texture filtering mode:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Texture filtering mode:", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 6, defaultHeightInput->getPosition().y+30);		
@@ -205,7 +205,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	texFilteringComboBox->setPosition(label2->getPosition().x - 6, label2->getPosition().y+18);
 	
 
-	label2 = new ScreenLabel(L"Anisotropic filtering:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Anisotropic filtering:", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);	
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 6, texFilteringComboBox->getPosition().y+30);		
@@ -219,7 +219,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	afLevelComboBox->addComboItem("16x Anisotropic Filtering");			
 	afLevelComboBox->setPosition(label2->getPosition().x-6, label2->getPosition().y+18);
 
-	label2 = new ScreenLabel(L"Framerate", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Framerate", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 6, afLevelComboBox->getPosition().y+30);		
@@ -233,13 +233,13 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	vSyncCheckBox->setPosition(label2->getPosition().x + 80, label2->getPosition().y+18);
 	mainSettingsWindow->addChild(vSyncCheckBox);
 	
-	label2 = new ScreenLabel(L"STARTUP OPTIONS", 18, "section", Label::ANTIALIAS_FULL);	
+	label2 = new SceneLabel(L"STARTUP OPTIONS", 18, "section", Label::ANTIALIAS_FULL);	
 	label2->setColor(1.0, 1.0, 1.0, 0.4);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding, vSyncCheckBox->getPosition().y+vSyncCheckBox->getHeight()+20);		
 	
 	
-	label2 = new ScreenLabel(L"Entry point file", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Entry point file", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);	
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding + 6, vSyncCheckBox->getPosition().y+80);		
@@ -253,7 +253,7 @@ PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectMana
 	mainSettingsWindow->addChild(aaLevelComboBox);		
 	mainSettingsWindow->addChild(texFilteringComboBox);	
 
-	label2 = new ScreenLabel(L"Background color:", fontSize, fontName, Label::ANTIALIAS_FULL);
+	label2 = new SceneLabel(L"Background color:", fontSize, fontName, Label::ANTIALIAS_FULL);
 	label2->setColor(1.0, 1.0, 1.0, 0.5);
 	mainSettingsWindow->addChild(label2);
 	label2->setPosition(padding, entryPointInput->getPosition().y+entryPointInput->getHeight()+10);		
@@ -407,7 +407,7 @@ bool PolycodeProjectEditor::openFile(OSFileEntry filePath) {
 
 void PolycodeProjectEditor::Resize(int x, int y) {
 	
-	headerBg->setShapeSize(x, 30);
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, 30);
 	
 	PolycodeEditor::Resize(x,y);	
 }

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

@@ -115,10 +115,10 @@ PropEvent::~PropEvent() {
 
 PropList::PropList(String caption) : UIElement() {
 
-	setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	setAnchorPoint(-1.0, -1.0, 0.0);
 
-	bg = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
-	bg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiBgColor"));
 	
 	addChild(bg);
@@ -127,18 +127,18 @@ PropList::PropList(String caption) : UIElement() {
 	
 	blockMouseInput = true;
 
-	bg2 = new ScreenShape(ScreenShape::SHAPE_RECT, 10,10);
-	bg2->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bg2 = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10,10);
+	bg2->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg2->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	
 	addChild(bg2);
 
-	ScreenLabel *label = new ScreenLabel(caption, 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel(caption, 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(10, 3);
 
-	propContents = new ScreenEntity();
+	propContents = new Entity();
 	propContents->processInputEvents = true;
 		
 	scrollContainer = new UIScrollContainer(propContents, false, true, 100, 100);
@@ -158,7 +158,7 @@ void PropList::updateProps() {
 }
 
 void PropList::updateSize() {
-	Resize(width, height);
+	Resize(getWidth(), getHeight());
 	scrollContainer->setScrollValue(0, 0);	
 }
 		
@@ -168,8 +168,8 @@ void PropList::Resize(Number width, Number height) {
 		
 	scrollContainer->Resize(width, height-30);
 	
-	bg->setShapeSize(width, height);
-	bg2->setShapeSize(width, 30);	
+	bg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, height);
+	bg2->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);	
 	
 	Number offsetY = 0;
 	for(int i=0; i < props.size(); i++) {
@@ -211,17 +211,17 @@ PropSheet::PropSheet(String caption, String type) : UIElement() {
 	
 	customUndoHandler = false;
 	
-	bg = new ScreenShape(ScreenShape::SHAPE_RECT, 30,30);
+	bg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,30);
 	addChild(bg);
 	bg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiSmallHeaderBgColor"));
-	bg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	
-	ScreenLabel *label = new ScreenLabel(caption, 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel(caption, 18, "section", Label::ANTIALIAS_FULL);
 	label->color.a = 0.5;
 	addChild(label);
 	label->setPosition(25, 3);	
 	
-	contents = new ScreenEntity();
+	contents = new Entity();
 	contents->processInputEvents = true;
 	addChild(contents);
 	contents->setPosition(20,35);
@@ -289,7 +289,7 @@ void PropSheet::Resize(Number width, Number height) {
 	setWidth(width);
 	setHeight(height);
 	
-	bg->setShapeSize(width, 30);
+	bg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
 	
 	Number yOffset = 0;
 	
@@ -318,12 +318,12 @@ PropProp::PropProp(String caption, String type) : UIElement() {
 
 	suppressChangeEvent = false;
 	propType = type;
-	label = new ScreenLabel(caption, 12);
+	label = new SceneLabel(caption, 12);
 	label->color.a = 0.4;
 	label->setPosition(0, 5);
 	addChild(label);
 	
-	propContents = new ScreenEntity();
+	propContents = new Entity();
 	propContents->processInputEvents = true;
 	addChild(propContents);
 	propContents->setPosition(100, 0);
@@ -337,12 +337,12 @@ PropProp::~PropProp() {
 
 Vector2Prop::Vector2Prop(String caption) : PropProp(caption, "Vector2") {
 
-	labelX = new ScreenLabel("X:", 11);
+	labelX = new SceneLabel("X:", 11);
 	labelX->color.a = 0.4;
 	propContents->addChild(labelX);
 	labelX->setPosition(-20, 6);	
 
-	labelY = new ScreenLabel("Y:", 11);
+	labelY = new SceneLabel("Y:", 11);
 	labelY->color.a = 0.4;
 	propContents->addChild(labelY);
 	labelY->setPosition(60, 6);	
@@ -530,7 +530,7 @@ SliderProp::SliderProp(String caption, Number min, Number max) : PropProp(captio
 	slider->setPosition(5, 8);
 	propContents->addChild(slider);
 	
-	valueLabel = new ScreenLabel("0.0", 10);
+	valueLabel = new SceneLabel("0.0", 10);
 	propContents->addChild(valueLabel);
 	valueLabel->setPosition(120, 5);
 	valueLabel->color.a = 0.6;
@@ -769,7 +769,7 @@ BoolProp::~BoolProp() {
 
 SoundProp::SoundProp(String caption) : PropProp(caption, "Sound"){
 
-	soundFile = new ScreenLabel("", 11);
+	soundFile = new SceneLabel("", 11);
 	soundFile->setPosition(0, 5);
 	propContents->addChild(soundFile);	
 	soundFile->color.a = 0.6;
@@ -912,8 +912,8 @@ void BezierCurveProp::handleEvent(Event *event) {
 }
 
 TextureProp::TextureProp(String caption) : PropProp(caption, "Texture"){
-	previewShape = new ScreenShape(ScreenShape::SHAPE_RECT, 48, 48);
-	previewShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	previewShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 48, 48);
+	previewShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	previewShape->setPosition(2, 1);
 	propContents->addChild(previewShape);
 
@@ -922,7 +922,7 @@ TextureProp::TextureProp(String caption) : PropProp(caption, "Texture"){
 	changeButton->setPosition(60, 5);
 	changeButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	
-	textureLabel = new ScreenLabel("", 12, "sans");
+	textureLabel = new SceneLabel("", 12, "sans");
 	propContents->addChild(textureLabel);
 	textureLabel->setPosition(-100, 32);
 	textureLabel->color.a = 0.3;
@@ -983,9 +983,9 @@ Texture* TextureProp::get() {
 ScreenSpriteProp::ScreenSpriteProp(String caption) : PropProp(caption, "ScreenSprite"){
 
 		previewSprite = new ScreenSprite("default/default.sprite");
-		previewSprite->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+		previewSprite->setAnchorPoint(-1.0, -1.0, 0.0);
 		previewSprite->setPosition(2, 1);
-		previewSprite->setShapeSize(48,48);		
+		previewSprite->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 48,48);		
 		propContents->addChild(previewSprite);	
 
 	
@@ -1038,9 +1038,9 @@ void ScreenSpriteProp::set(String fileName) {
 		currentData = fileName;
 		
 		previewSprite = new ScreenSprite(fileName);
-		previewSprite->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+		previewSprite->setAnchorPoint(-1.0, -1.0, 0.0);
 		previewSprite->setPosition(2, 1);
-		previewSprite->setShapeSize(48,48);		
+		previewSprite->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, 48,48);		
 		propContents->addChild(previewSprite);	
 	}
 }
@@ -1049,9 +1049,9 @@ String ScreenSpriteProp::get() {
 	return previewSprite->getFileName();
 }
 
-ScreenEntityInstanceProp::ScreenEntityInstanceProp(String caption) : PropProp(caption, "ScreenEntityInstance"){
-	previewInstance = new ScreenEntityInstance("default/default.entity2d");
-	previewInstance->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+EntityInstanceProp::EntityInstanceProp(String caption) : PropProp(caption, "EntityInstance"){
+	previewInstance = new EntityInstance("default/default.entity2d");
+	previewInstance->setAnchorPoint(-1.0, -1.0, 0.0);
 	previewInstance->setPosition(2, 1);
 	propContents->addChild(previewInstance);
 
@@ -1062,12 +1062,12 @@ ScreenEntityInstanceProp::ScreenEntityInstanceProp(String caption) : PropProp(ca
 	setHeight(50);
 }
 
-ScreenEntityInstanceProp::~ScreenEntityInstanceProp() {
+EntityInstanceProp::~EntityInstanceProp() {
 
 }
 
 
-void ScreenEntityInstanceProp::handleEvent(Event *event) {
+void EntityInstanceProp::handleEvent(Event *event) {
 
 	if(event->getDispatcher() == globalFrame->assetBrowser && event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
 		String filePath = globalFrame->assetBrowser->getSelectedAssetPath();
@@ -1089,18 +1089,18 @@ void ScreenEntityInstanceProp::handleEvent(Event *event) {
 	}
 }
 
-void ScreenEntityInstanceProp::setPropData(PolycodeEditorPropActionData* data) {
+void EntityInstanceProp::setPropData(PolycodeEditorPropActionData* data) {
 	set(data->stringVal);
 	dispatchEvent(new Event(), Event::CHANGE_EVENT);
 }
 
-void ScreenEntityInstanceProp::set(String fileName) {
+void EntityInstanceProp::set(String fileName) {
 
 	if(fileName != previewInstance->getFileName()) {
 		propContents->removeChild(previewInstance);
 		delete previewInstance;
-		previewInstance = new ScreenEntityInstance(fileName);
-		previewInstance->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+		previewInstance = new EntityInstance(fileName);
+		previewInstance->setAnchorPoint(-1.0, -1.0, 0.0);
 		previewInstance->setPosition(2, 1);
 		
 		lastData = currentData;
@@ -1115,11 +1115,11 @@ void ScreenEntityInstanceProp::set(String fileName) {
 	}
 }
 
-String ScreenEntityInstanceProp::get() {
+String EntityInstanceProp::get() {
 	return previewInstance->getFileName();
 }
 
-ShapeSheet::ShapeSheet() : PropSheet("SCREEN SHAPE", "ScreenShape") {
+ShapeSheet::ShapeSheet() : PropSheet("SCREEN SHAPE", "ScenePrimitive") {
 	shapeSize = new Vector2Prop("Shape size");
 	addProp(shapeSize);
 
@@ -1162,7 +1162,7 @@ void ShapeSheet::handleEvent(Event *event) {
 
 	if(event->getDispatcher() == shapeSize  && event->getEventCode() == Event::CHANGE_EVENT) {
 		lastShapeSize = shapeSize->get();
-		shape->setShapeSize(lastShapeSize.x, lastShapeSize.y);
+		shape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, lastShapeSize.x, lastShapeSize.y);
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);	
 	}
 
@@ -2135,7 +2135,7 @@ void ShaderTexturesSheet::setShader(Shader *shader, Material *material, ShaderBi
 	Resize(width, height);
 }
 
-ScreenEntitySheet::ScreenEntitySheet() : PropSheet("SCREEN ENTITY", "screen_entity") {
+EntitySheet::EntitySheet() : PropSheet("SCREEN ENTITY", "screen_entity") {
 
 	widthProp = new NumberProp("Width");
 	addProp(widthProp);
@@ -2148,11 +2148,11 @@ ScreenEntitySheet::ScreenEntitySheet() : PropSheet("SCREEN ENTITY", "screen_enti
 	lastEntity = NULL;
 }
 
-ScreenEntitySheet::~ScreenEntitySheet() {
+EntitySheet::~EntitySheet() {
 
 }
 		
-void ScreenEntitySheet::handleEvent(Event *event) {
+void EntitySheet::handleEvent(Event *event) {
 	if(entity) {
 		if(event->getDispatcher() == widthProp) {
 			entity->setWidth(widthProp->get());
@@ -2166,7 +2166,7 @@ void ScreenEntitySheet::handleEvent(Event *event) {
 	PropSheet::handleEvent(event);	
 }
 
-void ScreenEntitySheet::Update() {
+void EntitySheet::Update() {
 	if(entity) {
 		enabled = true;
 		if(entity != lastEntity) {
@@ -2625,10 +2625,10 @@ void Transform2DSheet::handleEvent(Event *event) {
 
 	if(event->getDispatcher() == topLeftProp  && event->getEventCode() == Event::CHANGE_EVENT) {
 		if(topLeftProp->get()) {
-			lastPositionMode = ScreenEntity::POSITION_TOPLEFT;
+			lastPositionMode = Entity::POSITION_TOPLEFT;
 			entity->setPositionMode(lastPositionMode);
 		} else {
-			lastPositionMode = ScreenEntity::POSITION_CENTER;
+			lastPositionMode = Entity::POSITION_CENTER;
 			entity->setPositionMode(lastPositionMode);		
 		}
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
@@ -2654,7 +2654,7 @@ void Transform2DSheet::Update() {
 		}
 
 		if(entity->getPositionMode() != lastPositionMode) {
-			if(entity->getPositionMode() == ScreenEntity::POSITION_TOPLEFT) {
+			if(entity->getPositionMode() == Entity::POSITION_TOPLEFT) {
 				topLeftProp->set(true);
 			} else {
 				topLeftProp->set(false);			
@@ -2678,7 +2678,7 @@ Transform2DSheet::~Transform2DSheet() {
 
 }
 
-ScreenImageSheet::ScreenImageSheet() : PropSheet("SCREEN IMAGE", "ScreenImage") {
+UIImageSheet::UIImageSheet() : PropSheet("SCREEN IMAGE", "UIImage") {
 	image = NULL;
 	
 	texture = new TextureProp("Texture");
@@ -2688,11 +2688,11 @@ ScreenImageSheet::ScreenImageSheet() : PropSheet("SCREEN IMAGE", "ScreenImage")
 	propHeight = 100;
 }
 
-ScreenImageSheet::~ScreenImageSheet() {
+UIImageSheet::~UIImageSheet() {
 
 }
 		
-void ScreenImageSheet::handleEvent(Event *event) {
+void UIImageSheet::handleEvent(Event *event) {
 	if(!image)
 		return;
 
@@ -2701,14 +2701,14 @@ void ScreenImageSheet::handleEvent(Event *event) {
 		
 		image->setTexture(selectedTexture);
 		selectedTexture->reloadOnFileModify = true;
-		image->setShapeSize(selectedTexture->getWidth(), selectedTexture->getHeight());
+		image->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, selectedTexture->getWidth(), selectedTexture->getHeight());
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 	}
 	
 	PropSheet::handleEvent(event);
 }
 
-void ScreenImageSheet::Update() {
+void UIImageSheet::Update() {
 	if(image) {
 		enabled = true;	
 		texture->set(image->getTexture());
@@ -2786,21 +2786,21 @@ void ScreenSpriteSheet::Update() {
 	}
 }
 
-ScreenEntityInstanceSheet::ScreenEntityInstanceSheet() : PropSheet("ENTITY INSTANCE", "ScreenEntityInstance") {
+EntityInstanceSheet::EntityInstanceSheet() : PropSheet("ENTITY INSTANCE", "EntityInstance") {
 	instance = NULL;
 	
-	instanceProp = new ScreenEntityInstanceProp("Entity file");
+	instanceProp = new EntityInstanceProp("Entity file");
 	instanceProp->addEventListener(this, Event::CHANGE_EVENT);
 	addProp(instanceProp);
 	
 	propHeight = 100;
 }
 
-ScreenEntityInstanceSheet::~ScreenEntityInstanceSheet() {
+EntityInstanceSheet::~EntityInstanceSheet() {
 
 }
 		
-void ScreenEntityInstanceSheet::handleEvent(Event *event) {
+void EntityInstanceSheet::handleEvent(Event *event) {
 	if(!instance)
 		return;
 
@@ -2817,7 +2817,7 @@ void ScreenEntityInstanceSheet::handleEvent(Event *event) {
 	PropSheet::handleEvent(event);
 }
 
-void ScreenEntityInstanceSheet::Update() {
+void EntityInstanceSheet::Update() {
 	if(instance) {
 		enabled = true;	
 		instanceProp->set(instance->getFileName());
@@ -2826,7 +2826,7 @@ void ScreenEntityInstanceSheet::Update() {
 	}
 }
 
-ScreenLabelSheet::ScreenLabelSheet() : PropSheet("SCREEN LABEL", "ScreenLabel") {
+SceneLabelSheet::SceneLabelSheet() : PropSheet("SCREEN LABEL", "SceneLabel") {
 	label = NULL;
 	
 	caption = new StringProp("Contents");
@@ -2853,7 +2853,7 @@ ScreenLabelSheet::ScreenLabelSheet() : PropSheet("SCREEN LABEL", "ScreenLabel")
 	refreshFonts();
 }
 
-void ScreenLabelSheet::refreshFonts() {
+void SceneLabelSheet::refreshFonts() {
 	
 	FontManager *fontManager = CoreServices::getInstance()->getFontManager();
 	
@@ -2868,11 +2868,11 @@ void ScreenLabelSheet::refreshFonts() {
 
 }
 
-ScreenLabelSheet::~ScreenLabelSheet() {
+SceneLabelSheet::~SceneLabelSheet() {
 
 }
 
-void ScreenLabelSheet::handleEvent(Event *event) {
+void SceneLabelSheet::handleEvent(Event *event) {
 	if(!label)
 		return;
 
@@ -2917,7 +2917,7 @@ void ScreenLabelSheet::handleEvent(Event *event) {
 	PropSheet::handleEvent(event);
 }
 
-void ScreenLabelSheet::Update() {
+void SceneLabelSheet::Update() {
 	if(label) {
 		enabled = true;		
 		if(label != lastLabel) {

Разница между файлами не показана из-за своего большого размера
+ 160 - 160
IDE/Contents/Source/PolycodeScreenEditor.cpp


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

@@ -100,9 +100,9 @@ SpriteAnimationEntry::~SpriteAnimationEntry() {
 }
 
 PolycodeSpriteEditor::PolycodeSpriteEditor() : PolycodeEditor(true){
-	headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
+	headerBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE,10,10);
 	addChild(headerBg);
-	headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	
 	initialLoad = false;
@@ -131,7 +131,7 @@ PolycodeSpriteEditor::PolycodeSpriteEditor() : PolycodeEditor(true){
 			
 	baseProps->propHeight = 180;
 	
-	ScreenLabel *label = new ScreenLabel("PREVIEW", 18, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("PREVIEW", 18, "section", Label::ANTIALIAS_FULL);
 	label->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderFontColor"));
 	addChild(label);
 	label->setPosition(390, 36);
@@ -140,7 +140,7 @@ PolycodeSpriteEditor::PolycodeSpriteEditor() : PolycodeEditor(true){
 	PropSheet *animationProps = new PropSheet("ANIMATIONS", "");
 	propList->addPropSheet(animationProps);
 
-	ScreenLabel *animHelpLabel = new ScreenLabel("Comma separated frames, ranges or repeats (e.g. 1,2,3-7,8x5)", 11);
+	SceneLabel *animHelpLabel = new SceneLabel("Comma separated frames, ranges or repeats (e.g. 1,2,3-7,8x5)", 11);
 	animHelpLabel->color.a = 0.4;
 	animationProps->addChild(animHelpLabel);
 	animHelpLabel->setPosition(5, 40);
@@ -209,13 +209,13 @@ void PolycodeSpriteEditor::handleEvent(Event *event) {
 
 	if(event->getDispatcher() == widthProp) {
 		previewSprite->setSpriteSize(widthProp->get(), heightProp->get());
-		previewSprite->setShapeSize(widthProp->get(), heightProp->get());
+		previewSprite->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, widthProp->get(), heightProp->get());
 		previewSprite->recalculateSpriteDimensions();		
 	}
 
 	if(event->getDispatcher() == heightProp) {
 		previewSprite->setSpriteSize(widthProp->get(), heightProp->get());
-		previewSprite->setShapeSize(widthProp->get(), heightProp->get());
+		previewSprite->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, widthProp->get(), heightProp->get());
 		previewSprite->recalculateSpriteDimensions();		
 	}
 	
@@ -273,7 +273,7 @@ bool PolycodeSpriteEditor::openFile(OSFileEntry filePath) {
 	
 	previewSprite = new ScreenSprite(filePath.fullPath);
 	addChild(previewSprite);
-	previewSprite->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	previewSprite->setAnchorPoint(-1.0, -1.0, 0.0);
 	previewSprite->setPosition(400, 80);				
 	zoomBox->setSelectedIndex(0);
 	previewSprite->getTexture()->reloadOnFileModify = true;	
@@ -327,7 +327,7 @@ void PolycodeSpriteEditor::saveFile() {
 }
 
 void PolycodeSpriteEditor::Resize(int x, int y) {
-	headerBg->setShapeSize(x, 30);
+	headerBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, x, 30);
 	propList->Resize(370, y);
 	propList->updateProps();	
 	PolycodeEditor::Resize(x,y);	

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

@@ -640,18 +640,18 @@ void PolycodeTextEditor::Resize(int x, int y) {
 }
 
 FindBar::FindBar() : UIElement() {
-	barBg = new ScreenShape(ScreenShape::SHAPE_RECT, 30,30);
-	barBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	barBg = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,30);
+	barBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	barBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
 	addChild(barBg);
-	this->height = 30;
+	setHeight(30);
 	
-	ScreenLabel *findLabel = new ScreenLabel("FIND", 18, "section");
+	SceneLabel *findLabel = new SceneLabel("FIND", 18, "section");
 	addChild(findLabel);
 	findLabel->setColor(1.0, 1.0, 1.0, 0.6);
 	findLabel->setPosition(10,3);
 
-	ScreenLabel *replaceLabel = new ScreenLabel("REPLACE", 18, "section");
+	SceneLabel *replaceLabel = new SceneLabel("REPLACE", 18, "section");
 	addChild(replaceLabel);
 	replaceLabel->setColor(1.0, 1.0, 1.0, 0.6);
 	replaceLabel->setPosition(200,3);
@@ -670,7 +670,7 @@ FindBar::FindBar() : UIElement() {
 	addChild(replaceAllButton);
 	replaceAllButton->setPosition(420, 3);
 
-	ScreenImage *functionIcon = new ScreenImage("Images/function_icon.png");
+	UIImage *functionIcon = new UIImage("Images/function_icon.png");
 	addChild(functionIcon);
 	functionIcon->setPosition(540, 5);	
 	
@@ -701,7 +701,7 @@ FindBar::~FindBar(){
 }
 
 void FindBar::setBarWidth(int width) {
-	barBg->setShapeSize(width, 30);
+	barBg->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, width, 30);
 	closeButton->setPosition(width - 30, 5);
 	functionList->Resize(width-560-60, functionList->getHeight());
 }

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

@@ -28,7 +28,7 @@ SettingsWindow::SettingsWindow() : UIWindow(L"Settings", SETTINGS_WINDOW_WIDTH,
 
 	closeOnEscape = true;
 
-	ScreenLabel *label = new ScreenLabel("TEXT EDITING", 22, "section", Label::ANTIALIAS_FULL);
+	SceneLabel *label = new SceneLabel("TEXT EDITING", 22, "section", Label::ANTIALIAS_FULL);
 	addChild(label);
 	label->color.a = 0.4;
 	label->setPosition(padding, 50);
@@ -47,7 +47,7 @@ SettingsWindow::SettingsWindow() : UIWindow(L"Settings", SETTINGS_WINDOW_WIDTH,
 	externalTextEditorCommand->setPosition(padding, EDITOR_BROWSE_POS);
 	
 	
-	label = new ScreenLabel("Syntax highlighting theme", 12);
+	label = new SceneLabel("Syntax highlighting theme", 12);
 	addChild(label);
 	label->color.a = 0.6;
 	label->setPosition(padding, EDITOR_BROWSE_POS + 35);

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

@@ -29,15 +29,15 @@ AssetEntry::AssetEntry(String assetPath, String assetName, String extension) : U
 	if(assetName.length() > 20)
 		assetName = assetName.substr(0,20)+"...";
 
-	selectShape = new ScreenShape(ScreenShape::SHAPE_RECT, 120, 100);
+	selectShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 120, 100);
 	selectShape->visible = false;
-	selectShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	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 ScreenShape(ScreenShape::SHAPE_RECT, 64,64);
-	imageShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	imageShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 64,64);
+	imageShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(imageShape);
 	
 	extension = extension.toLowerCase();
@@ -61,10 +61,10 @@ AssetEntry::AssetEntry(String assetPath, String assetName, String extension) : U
 	
 	imageShape->setPosition(28, 10);
 	
-	nameLabel = new ScreenLabel(assetName, 10);
+	nameLabel = new SceneLabel(assetName, 10);
 	addChild(nameLabel);
 	nameLabel->color.a = 0.5;
-	nameLabel->setPositionMode(ScreenEntity::POSITION_CENTER);
+	nameLabel->setAnchorPoint(0.0, 0.0, 0.0);
 	nameLabel->setPosition(60, 90);
 }
 
@@ -76,8 +76,8 @@ AssetEntry::~AssetEntry() {
 
 AssetList::AssetList() : UIElement() {
 	
-	bgShape = new ScreenShape(ScreenShape::SHAPE_RECT, 100,100);
-	bgShape->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
+	bgShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 100,100);
+	bgShape->setAnchorPoint(-1.0, -1.0, 0.0);
 	bgShape->setColor(0.0, 0.0, 0.0, 0.4);
 	addChild(bgShape);
 	
@@ -143,16 +143,16 @@ void AssetList::showFolder(String folderPath) {
 		}
 	}
 	
-	width = 640;
+	setWidth(640);
 	
 	if(xPos == 20) {
-		height = yPos+20;
+		setHeight(yPos+20);
 	} else {
-		height = yPos + 120;	
+		setHeight(yPos + 120);
 	}
 
 	
-	bgShape->setShapeSize(width, height);
+	bgShape->setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), getHeight());
 	bgShape->rebuildTransformMatrix();
 	rebuildTransformMatrix();	
 }

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

@@ -77,11 +77,11 @@ TextInputPopup::~TextInputPopup() {
 
 YesNoPopup::YesNoPopup() : UIWindow(L"", 300, 80) {
 	
-	captionLabel = new ScreenLabel("This is a caption", 12);	
+	captionLabel = new SceneLabel("This is a caption", 12);	
 	addChild(captionLabel);
 	captionLabel->setPosition(padding, 35);
 		
-	buttonAnchor = new ScreenEntity();
+	buttonAnchor = new Entity();
 	buttonAnchor->processInputEvents = true;
 	addChild(buttonAnchor);
 			
@@ -133,11 +133,11 @@ YesNoPopup::~YesNoPopup() {
 
 YesNoCancelPopup::YesNoCancelPopup() : UIWindow(L"", 300, 80) {
 	
-	captionLabel = new ScreenLabel("This is a caption", 12);	
+	captionLabel = new SceneLabel("This is a caption", 12);	
 	addChild(captionLabel);
 	captionLabel->setPosition(padding, 35);
 		
-	buttonAnchor = new ScreenEntity();
+	buttonAnchor = new Entity();
 	buttonAnchor->processInputEvents = true;
 	addChild(buttonAnchor);
 	

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

@@ -75,6 +75,7 @@ namespace Polycode {
 	class _PolyExport UIImage : public UIElement {
 		public:
 			UIImage(String imagePath);
+			SceneImage *getImage();
 		protected:
 			SceneImage *image;
 	};

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

@@ -31,6 +31,10 @@ UIImage::UIImage(String imagePath) : UIElement() {
 	setHeight(image->bBox.y);	
 }
 
+SceneImage *UIImage::getImage() {
+	return image;
+}
+
 UIElement::UIElement() : Entity() {
 	setAnchorPoint(-1.0, -1.0, 0.0);
 	processInputEvents = true;

Некоторые файлы не были показаны из-за большого количества измененных файлов