This project is read-only.

relative resizing

Nov 2, 2012 at 3:30 PM

Wouldn't it be cool, if the UI isn't fixed for one resolution?
Well, if I create a game with manipulateable window size the ui won't get repositioned or resized.

For this issue I made some time ago some functions for gdi in visual basic.

I used it some weeks ago in another XNA project, with some changes.

May be, this could be implemented in Ruminate because this feature would be really cool.

https://gist.github.com/8772192bd0e63c6e65cd

Nov 3, 2012 at 7:38 PM

I agree and thanks for the code. I intend to do this its just a matter if when I'll have the time.

Nov 5, 2012 at 1:16 PM

Yes, using logical coordinates would be great!

Also, having full control over the height of created widgets and full resize and logical coordinate change after creation is a must for a lot of not trivial dialogs. I'll try something quick to see how it works and if I am successful might post a patch.

I am testing out Ruminate and if it works out, I am going to need to create a GUI as feature rich as you would find in a desktop application.

I am also investigating performance issues for nested scroll areas. They are incredibly slow on my machines.

Nov 7, 2012 at 1:22 AM

Since logical coordinates seem so popular I'll bump it up to the top of my to do list. Also nested scroll areas do cause a bit of an performance hit. The event triggered to refresh the scroll bar and its children seems is probably doing more work than is necessary. 

Nov 8, 2012 at 10:11 AM
Edited Nov 8, 2012 at 10:12 AM

Does adjusting the AbsoluteArea work in nested controls? This is what I'm using right now to reposition two buttons at a resize:

 

        public override void OnResize() {
            int h = Enjin.Device.PresentationParameters.BackBufferHeight;

            Rectangle r = btnBody.AbsoluteArea;
            r.Y = h - 10 - r.Height;
            btnBody.AbsoluteArea = r;

            r = btnFoundation.AbsoluteArea;
            r.Y = h - 10 - r.Height;
            btnFoundation.AbsoluteArea = r; 

            gui.Resize();
        }


Also, a question: if I want to have multiple button heights, do I need to create a new skin and choose the skin the button uses based on height?

 

Nov 9, 2012 at 4:05 AM
Edited Nov 9, 2012 at 4:05 AM

Does adjusting the AbsoluteArea work in nested controls? 

It should. The way things work is there are sizing rules usually in the attach method that uses the Area field in the Widget class to create the size. I'm moving this logic from this to a sizing function that way you can alter the fields the rules use to size the object. 

Also, a question: if I want to have multiple button heights, do I need to create a new skin and choose the skin the button uses based on height?

There are various types of render rules. The button uses the sliding door technique so it can not be resized vertically. You could create a panel like skin (had edges and corners) which would allow you to resize it in any way.