Is there a way to change the window size/resolution?

About Monkey 2 Forums Monkey 2 Programming Help Is there a way to change the window size/resolution?

This topic contains 8 replies, has 5 voices, and was last updated by  SekaiChi 5 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #14821

    Skaruts
    Participant

    I’ve been trying to figure this out, but there doesn’t seem to be an obvious way to do it.

    I also tried recreating the window with a new size, but that leaves me with two windows because I don’t know how to destroy the first one.

    #14823

    Mark Sibly
    Keymaster

    The easiest way is to override the window size in the window constructor.

    Have a look at the mojo template project – replace the 640,480 with your desired size:

    #14824

    Skaruts
    Participant

    Ah, sorry, I should’ve been more clear… :\

    I meant it as in changing the window size during runtime. If I could do that I might have different resolution options that the player can choose from.

    #14828

    Mark Sibly
    Keymaster

    The View.Frame property can be used to ‘layout’ views – try adding this to your Window class:

    I’m reluctant to add this to the Window class as a ‘core’ method as it duplicates functionality that’s already there (ie: Frame). However, perhaps it would make sense to add some stuff like via built-in extension methods? This approach worked out well with Entity class IMO.

    And of course if your doing fullscreen there is also BeginFullscreen/EndFullscreen…

    #14830

    Skaruts
    Participant

    Hey that works! 🙂

    Thanks.

    Well, I think maybe at least there could be a sample program that uses it. Maybe Pakz could add it to his collection of examples. Unless he already has it and I overlooked it…

    #14832

    AdamStrange
    Participant

    Or, you could add this to mojo/app/windows:

    [/crayon]
    #14840

    abakobo
    Participant

    add some stuff like via built-in extension methods?

    Yes a simpler official resize method would be nice…

    #14843

    Mark Sibly
    Keymaster

    > Yes a simpler official resize method would be nice…

    Ok, will do.

    #14848

    SekaiChi
    Participant

    I have a request, would it possible to also create a flag for the titlebar on Android so it could be toggled at runtime?

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

You must be logged in to reply to this topic.