playMaker

Author Topic: Manual refresh editor widndow  (Read 1028 times)

giperballl

  • Playmaker Newbie
  • *
  • Posts: 3
Manual refresh editor widndow
« on: April 13, 2015, 05:35:25 AM »
Hi, I work with my editor window. This window can add new states to fsm, but after adding new state, I must refresh window editor. Problem in playmaker editor canvas: she stays too small for new field of fsm, and I get cropped image (screenshoot in attachmets). My solution for now is send events to creating and momentaly deliting new state (if I click in canvas ctrl+click, canvas refreshing). This is code for refresh:
Code: [Select]
           
            Event t = new Event();

            t = new Event();
            t.control = true;
            t.type = EventType.MouseDown;
            t.mousePosition = new Vector2(0, 100);
            FsmEditor.Window.SendEvent(t);

            t = new Event();
            t.control = true;
            t.type = EventType.MouseUp;
            t.mousePosition = new Vector2(0, 100);
            FsmEditor.Window.SendEvent(t);

            t = new Event();
            t.control = true;
            t.shift = true;
            t.type = EventType.MouseDown;
            t.mousePosition = new Vector2(0, 100);
            FsmEditor.Window.SendEvent(t);

            t = new Event();
            t.control = true;
            t.shift = true;
            t.type = EventType.MouseUp;
            t.mousePosition = new Vector2(0, 100);
            FsmEditor.Window.SendEvent(t);

But this code have two bad things: this code absolutely not beatiful and if I alredy have state in point 0,100 it will be deleted. Is anybody know what else can I do?
« Last Edit: April 13, 2015, 06:09:57 AM by giperballl »