About Monkey 2 › Forums › Monkey 2 Development › mojox needs ListboxView and CanvasView
This topic contains 5 replies, has 2 voices, and was last updated by
skn3 2 years, 6 months ago.
-
AuthorPosts
-
October 13, 2016 at 1:57 pm #4428
Hey,
I started a little tool in mx2 the other day but have decided to halt as I needed these two gadgets in mojox. The tool is very simply a way for me to load my atlas, pick items from it, add game values to those items and then dump it into an xml file. I plan to have 100’s of items, so I wanted to make a quick tool to facilitate this visually.
Listbox, to show currently hilighted item(s) in a list of scrollable items.
Canvas, a gadget that provides a generic way for rendering/interacting-with custom controls via a lambda function.
I could go ahead and create these myself, but I am trying not to distract myself off project like this. I have a bad habit of getting distracted from making games, so I am trying really hard to stay focused. If I start writing custom controls, then I may as well just use the time to do it manually in XML.
These are core components for any GUI so it would be a waste for me to implement them, if they are going to be implemented officially at some point.
October 16, 2016 at 3:10 am #4441Just added ListView – more coming, esp. more layout views.
To create a custom view, you need to extend ‘View’ and implement OnRender.
October 16, 2016 at 11:31 am #4447Awesome stuff, thanks! I will have a bit of a play today
October 17, 2016 at 10:35 pm #4491Is there currently a way to layout two columns, have one fixed width and the other fill the rest?
I have a few nested DockingView’s and it doesn’t seem to work.
October 17, 2016 at 11:39 pm #4493A single docking view will do the trick:
Monkey12345...dockingView=new DockingViewdockingView.AddView( leftView,"left",100 )dockingView.ContentView=mainView...leftView here is probably your ListView, and mainView is probably a custom/canvas view.
The ‘ContentView’ of a docking view is what takes up all the space left over after “left”, “right” etc views are layed out.
The ‘100’ is the width of the left view – you can add ‘,True’ after this to make it resizable.
October 18, 2016 at 9:27 am #4508Ahhhh cool thanks. I was trying to just add a second view and set it to “100%”
-
AuthorPosts
You must be logged in to reply to this topic.