How to keep sprites same physical size across devi

0 favourites
  • 8 posts
From the Asset Store
A versatile and wide-ranging selection of large to medium-sized creature sounds.
  • In C2, how would you keep sprites the same physical size across different sized devices?

    Example: I have a game that I want to run on Windows 8 and Windows Phone 8. They obviously have different screen sizes, but I would still like a certain sprite to appear about one centimeter in diameter on both devices.

    I've looked in the FAQs, manual, and search, but haven't found a suitable method yet, besides manually scaling the sprites depending on the platform. I was hoping for a much more accurate method, like getting the physical screen size of the "browser"/device. Or, possibly even getting a pixel density. The Browser object/plugin has a `DevicePixelRatio` (the display pixels per CSS pixel), but that wouldn't seem to work because a phone device can have the exact same number of CSS pixels as a laptop.

    Anybody know any workarounds for maintaining the same final-sized sprite better than adjusting size of sprite depending on platform?

    One more note, I'm using the "Scale Outer" scaling mode. Not sure if that is helpful or not.

  • I think this would be impossible without knowing the physical size of the device and/or it's pixeldensity. This is different for each device and not only each platform, so only if there is a way to get pixeldensity per device or screen and have events set up to counteract it, would this be possible.

  • No it's not easily possible to do this.

    After looking into this myself withouth C2 and working with direct JS. I found that the Browsers do not reliable report the em or px density accuratly.

    The only way to do this is to have the user report the DPI and the screen dimensions manually at the games run time. This means your going to have to use a very large table of devices.

    Some devices can be detected by C2 well enough as int he IOS family. But the Android, Tize, Windows8.... your on your own.

    it's prtty crummy. I wanted to do the same thing over a year ago.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One idea - and it might not be a good idea - at the start of the game ask the player to click on the circle that is closest to the size of a pound coin or some other easily recognisable coin/thing, then using this "scale"...

  • Maybe this could help:

    dpi.lv

  • One idea - and it might not be a good idea - at the start of the game ask the player to click on the circle that is closest to the size of a pound coin or some other easily recognisable coin/thing, then using this "scale"...

    Definitely not recommend using coins as a reference, since pounds are only used in UK. Even 1 Euro (or US quarter) are not easily available on all parts of the world.

  • jayderyu, definitely a creative idea. My first idea/response for this was that a great community-effort plugin could be created and everybody here just adding their own devices. But, I'm sure this information is already out there somewhere, we just have to find it and make an API call to it.

    RamPackWobble, good idea, I was thinking of something like that also. Maybe we would ask users to choose a circle the think closest to one inch (or roughly 2.54cm). Or, expanding on that, it might be good enough to just label the range of circles from easy to hard, if a game could be formed like that.

    JohnnySheffield, it looks like a great website. It probably works most of the time, but didn't for me. I have a dual-monitor setup (16 inch laptop, 24 inch monitor) and the results got the pixel count right for each screen, but said both were only 13.3 inches.

    Even after seeing these great ideas, I still feel that there are more possibilities out there. I just haven't thought about them yet. I'm interested in all possibilities, no matter how easy/difficult they may be to implement.

  • Definitely not recommend using coins as a reference, since pounds are only used in UK. Even 1 Euro (or US quarter) are not easily available on all parts of the world.

    Good point about not using a coin.

    Choose the ruler that is closes to life size ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)