public LayerWindow(FizzikSpriteEditor editor) : base(editor)
        {
            layerRects = new List <Rect>();

            pixel = new Texture2D(1, 1);
            pixel.SetPixel(0, 0, Color.white);
            pixel.filterMode = FilterMode.Point;
            pixel.Apply();

            layersBackgroundTex = new Texture2D(3, 3);
            layersBackgroundTex.SetPixels(Enumerable.Repeat(Color.blue, 3 * 3).ToArray());
            layersBackgroundTex.filterMode = FilterMode.Point;
            layersBackgroundTex.Apply();

            layerBackgroundTex = new Texture2D(3, 3);
            layerBackgroundTex.SetPixels(Enumerable.Repeat(Color.red, 3 * 3).ToArray());
            layerBackgroundTex.filterMode = FilterMode.Point;
            layerBackgroundTex.Apply();

            layerSelectedBackgroundTex = new Texture2D(3, 3);
            layerSelectedBackgroundTex.SetPixels(Enumerable.Repeat(Color.grey, 3 * 3).ToArray());
            layerSelectedBackgroundTex.filterMode = FilterMode.Point;
            layerSelectedBackgroundTex.Apply();

            //Register delegates
            LeftMouseButtonClickTracked  += checkLayerRectsForLeftMouseClick;
            RightMouseButtonClickTracked += checkLayerRectsForRightMouseClick;
            LeftMouseButtonDragged       += handleLayerDragging;
            LeftMouseButtonDragEnded     += handleLayerDraggingEnded;
        }
        public static bool openFromProjectBrowser(int instanceID, int line)
        {
            Object obj = EditorUtility.InstanceIDToObject(instanceID);

            if (obj is FizzikSprite)
            {
                return(FizzikSpriteEditor.openAssetFromProjectBrowser(obj));
            }

            return(false);
        }
Exemplo n.º 3
0
        public override void Init(FizzikSpriteEditor editor)
        {
            base.Init(editor);

            float w  = dss_GridOverlayOptions_rect.size.x;
            float h  = dss_GridOverlayOptions_rect.size.y;
            float hw = w / 2f;
            float hh = h / 2f;

            position = new Rect(editor.position.center.x - hw, editor.position.center.y - hh, w, h);
            minSize  = new Vector2(w, h);
            maxSize  = new Vector2(w, h);
        }
Exemplo n.º 4
0
        public FizzikSubWindow(FizzikSpriteEditor editor)
        {
            this.editor = editor;

            //Init click tracking
            clickTrackMouseDown    = new bool[] { false, false, false };
            clickTrackMouseDownPos = new Vector2[] { Vector2.zero, Vector2.zero, Vector2.zero };


            setCurrentRect(getDefaultRect()); //Initialization of currentRect that sets up all structures, in case loadUserSettings implementation is blank.

            loadUserSettings();
        }
 public DeveloperWindow(FizzikSpriteEditor editor) : base(editor)
 {
 }
Exemplo n.º 6
0
        public ColorPalette(FizzikSpriteEditor editor) : base(editor)
        {
            //Define white btn background image canvas
            btnImage            = new Texture2D(3, 3);
            btnImage.filterMode = FilterMode.Point;
            btnImage.SetPixels(Enumerable.Repeat(Color.black, 3 * 3).ToArray());
            btnImage.SetPixel(1, 1, Color.white);
            btnImage.Apply();

            //Define default colors
            int col = 0;

            defaultColors = Enumerable.Repeat(Color.white, DEFAULTCOLORS_COLUMNS * DEFAULTCOLORS_ROWS).ToArray();
            col           = 0;
            setDefaultColor(col, 0, new Color(1f, 1f, 1f, 1f));
            setDefaultColor(col, 1, new Color(.8f, .8f, .8f, 1f));
            setDefaultColor(col, 2, new Color(.6f, .6f, .6f, 1f));
            setDefaultColor(col, 3, new Color(.4f, .4f, .4f, 1f));
            setDefaultColor(col, 4, new Color(.2f, .2f, .2f, 1f));
            setDefaultColor(col, 5, new Color(0f, 0f, 0f, 1f));
            col = 1;
            setDefaultColor(col, 0, new Color(1f, 0f, 0f, 1f));
            setDefaultColor(col, 1, new Color(.6f, 0f, 0f, 1f));
            setDefaultColor(col, 2, new Color(.2f, 0f, 0f, 1f));
            setDefaultColor(col, 3, new Color(134 / 255f, 49 / 255f, 62 / 255f, 1f));
            setDefaultColor(col, 4, new Color(183 / 255f, 100 / 255f, 79 / 255f, 1f));
            setDefaultColor(col, 5, new Color(51 / 255f, 32 / 255f, 11 / 255f, 1f));
            col = 2;
            setDefaultColor(col, 0, new Color(0f, 1f, 0f, 1f));
            setDefaultColor(col, 1, new Color(0f, .6f, 0f, 1f));
            setDefaultColor(col, 2, new Color(0f, .2f, 0f, 1f));
            setDefaultColor(col, 3, new Color(71 / 255f, 105 / 255f, 73 / 255f, 1f));
            setDefaultColor(col, 4, new Color(202 / 255f, 140 / 255f, 125 / 255f, 1f));
            setDefaultColor(col, 5, new Color(81 / 255f, 57 / 255f, 32 / 255f, 1f));
            col = 3;
            setDefaultColor(col, 0, new Color(0f, 0f, 1f, 1f));
            setDefaultColor(col, 1, new Color(0f, 0f, .6f, 1f));
            setDefaultColor(col, 2, new Color(0f, 0f, .2f, 1f));
            setDefaultColor(col, 3, new Color(65 / 255f, 87 / 255f, 139 / 255f, 1f));
            setDefaultColor(col, 4, new Color(218 / 255f, 158 / 255f, 92 / 255f, 1f));
            setDefaultColor(col, 5, new Color(104 / 255f, 80 / 255f, 55 / 255f, 1f));
            col = 4;
            setDefaultColor(col, 0, new Color(1f, 1f, 0f, 1f));
            setDefaultColor(col, 1, new Color(.6f, .6f, 0f, 1f));
            setDefaultColor(col, 2, new Color(.2f, .2f, 0f, 1f));
            setDefaultColor(col, 3, new Color(138 / 255f, 116 / 255f, 49 / 255f, 1f));
            setDefaultColor(col, 4, new Color(228 / 255f, 185 / 255f, 137 / 255f, 1f));
            setDefaultColor(col, 5, new Color(99 / 255f, 50 / 255f, 37 / 255f, 1f));
            col = 5;
            setDefaultColor(col, 0, new Color(0f, 1f, 1f, 1f));
            setDefaultColor(col, 1, new Color(0f, .6f, .6f, 1f));
            setDefaultColor(col, 2, new Color(0f, .2f, .2f, 1f));
            setDefaultColor(col, 3, new Color(90 / 255f, 128 / 255f, 128 / 255f, 1f));
            setDefaultColor(col, 4, new Color(210 / 255f, 184 / 255f, 130 / 255f, 1f));
            setDefaultColor(col, 5, new Color(183 / 255f, 143 / 255f, 70 / 255f, 1f));
            col = 6;
            setDefaultColor(col, 0, new Color(1f, 0f, 1f, 1f));
            setDefaultColor(col, 1, new Color(.6f, 0f, .6f, 1f));
            setDefaultColor(col, 2, new Color(.2f, 0f, .2f, 1f));
            setDefaultColor(col, 3, new Color(88 / 255f, 73 / 255f, 133 / 255f, 1f));
            setDefaultColor(col, 4, new Color(239 / 255f, 203 / 255f, 135 / 255f, 1f));
            setDefaultColor(col, 5, new Color(228 / 255f, 176 / 255f, 69 / 255f, 1f));
        }
Exemplo n.º 7
0
        public virtual void Init(FizzikSpriteEditor editor)
        {
            this.editor = editor;

            hasInit = true;
        }
 public ToolPalette(FizzikSpriteEditor editor) : base(editor)
 {
 }