[ DIDDY2 ] Virtual Resolutions

About Monkey 2 Forums Monkey 2 Programming Help [ DIDDY2 ] Virtual Resolutions

This topic contains 7 replies, has 3 voices, and was last updated by  therevills 1 year, 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #13014

    Amon
    Participant

    Do I need to account for the virtual resolution when plotting x,y of my character in a platform game? I ask because everything seems off target and my custom collision is not working as it should be. The collision code is borrowed from my monkeyX1 Diddy game that I’m converting now to MX2.

    #13019

    therevills
    Participant

    I dont think so, Diddy2 is just using the Monkey2 Virtual Resolution. Could you post an example?

    #13063

    APC
    Participant

    amon,

    Make sure you are setting the your character’s Handle to (0,0) , also set the layout of your Window or ScreenManager to letterbox, an gravity to (0,0).

    #13115

    Amon
    Participant

    It was the Handle throwing everything off. Thank you, APC.

    🙂

    #13129

    therevills
    Participant

    Diddy2 does autoload images with the handle set to the middle of the image. You can set the parameter to false if you dont want this:

    background  = AssetBank.LoadImage(level.backgroundFile + ".png", False)

    #13158

    Amon
    Participant

    Yep, but that’s single images only. What about for an animated strip of images or an atlas image?

    #13164

    APC
    Participant

    Amon, you have to set the Handle on every single image you load,

    #13200

    therevills
    Participant

    What about for an animated strip of images or an atlas image?

    Similar code really, the LoadAtlas method signture:

    Method LoadAtlas:Void(fileName:String, format:Int = SPARROW_ATLAS, setMidHandle:Bool = True)

    So something like this:

    AssetBank.LoadAtlas("chopper.xml", AssetBank.SPARROW_ATLAS, False)

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

You must be logged in to reply to this topic.