Mojox GUI + Game Rendering

About Monkey 2 Forums Monkey 2 Programming Help Mojox GUI + Game Rendering

This topic contains 4 replies, has 2 voices, and was last updated by  juliocmfj 5 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #14585

    juliocmfj
    Participant

    Good evening everyone. I’m taking a beating to use the Mojox library. I’m developing a library for retro style RPG games (like The Legend of Zelda [NES]) and would like to create a stage editor for it …

    Oh, that’s the problem. I’m completely lost here. In BlitzMax I did not have many complications, but in Monkey 2 I still did not understand how the GUI works.

    Does anyone have an example of how to join GUI interface with the rendering of the game itself?

    #14586

    Mark Sibly
    Keymaster

    The main idea is to write a ‘GameView’ style class that implements your game rendering, and then to add that to your app’s view hierarchy, eg:

    This sets up a docking view that contains your game view as its ‘main’ view and adds a resizable TextView on the right.

    Have a look in modules/mojox/tests for some mojox examples.

    #14587

    juliocmfj
    Participant

    Thank you Mark. (Now I’ve opened my vision a little more, but it’s still confusing …).

    Taking advantage of the hook, I also miss out on how the coordinates of the GUI components on the screen work.

    In BlitzMax, he used the x, y coordinates. I still try to understand how the organization works in Monkey 2.

    Could you give me a brief explanation of how it works?

    Note: I have already looked at all the examples and still I still do not understand very well.

    #14590

    Mark Sibly
    Keymaster

    The general idea is for mojox to do all the layout stuff for you, so you don’t have to worry about positions/sizes etc so much. This allows guis to work on a wide range of resolutions and devices and to respond very dynamically when windows are resized etc.

    You generally create a hierarchy of views using DockingViews, ToolBars, ListViews, TreeViews, GridViews etc and mojox does the positioning and sizing for you when it needs to update the GUI layout.

    #14592

    juliocmfj
    Participant

    Hey Mark … Now I understand how it works. I spent the day looking at all the forum posts related to Mojox, and it opened my mind more. I’m still confused about some things, but I understand their operation much more.

    I’ll keep doing my tests here. And once again, thank you for your help.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.