Detecting the size of the window automatically outside OnRender? Desktop size?

About Monkey 2 Forums Monkey 2 Programming Help Detecting the size of the window automatically outside OnRender? Desktop size?

This topic contains 4 replies, has 3 voices, and was last updated by  MikeHart 2 years, 8 months ago.

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

    MikeHart
    Participant

    Is there an event that is called before first OnRender event is called?

    The reason I ask is that I would like to be able to detect the size of the window once before the first OnRender event is called.

    And is there a way to detect the size of the desktop in mojo?

    #3268

    impixi
    Participant

    And is there a way to detect the size of the desktop in mojo?

    Store a reference to the AppInstance object and read the DesktopSize property:

    [/crayon]

    Though in my case the returned result is incorrect. I’m running my desktop at 4k (3840×2160) yet the DesktopSize property returns 2560×1440. Not sure what’s going on there…

    #3269

    Simon Armstrong
    Participant

    You don’t need to use a reference to your app (unless you are subclassing) as the global App variable will suffice (as in App.Run() and App.DesktopSize).

    #3270

    impixi
    Participant

    I just noticed that global App variable myself. Was going to correct myself but you beat me to it. 🙂

    #3313

    MikeHart
    Participant

    Thanks guys. Now all i need is to detect the size of the window outside OnRender.

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

You must be logged in to reply to this topic.