DPI for Android

Home Forums Monkey 2 Code Library DPI for Android

Tagged: , ,

This topic contains 2 replies, has 3 voices, and was last updated by  Amon 6 days, 10 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12800

    Abe _King_
    Participant

    SDL2, or the current version used in Monkey2, does not support DPI for Android. So if you’ve been frustrated trying to come up with a solution but weren’t satisfied, this is the way to go!

    Why would I want this?
    Because you can now have elements displayed at the same size across desktops and Android (unsure about ios) based on inches instead of pixels – which is important in itself, and even more important with UI.

    .
    .
    Java File

    Store the Java file somewhere logical in your app. Say in a folder called “native”. The floats are cast to ints for the time being. There aren’t externs for float methods in Monkey2 at this time.

    .

    .


    Monkey 2 Implementation

    .

    .

     


    How To Use it

    #12803

    therevills
    Participant

    Cool! Didnt know you could use Java in the externs for Monkey2!

    #12804

    Amon
    Participant

    Yep, deffo cool.

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

You must be logged in to reply to this topic.