Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How does Qiso render the map on the screen edges
Started by J@V0 Sep 12 2019 10:48 AM

7 replies to this topic
qiso
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

J@V0

[GLOBAL: userInfoPane.html]
J@V0
  • Enthusiast

  • 93 posts
  • Corona SDK

I'm experiencing a different behavior between the map rendering in the simulator and on my Android phone.

If you look at the bottom of the screen, the map is cropped horizontally on my mobile but not on the simulator.

 

I wonder if this has to do with my config.lua and if so, how can I achieve the same behavior as I get in the simulator?

Simulator:

Attached File  2019-09-12_20h30_51.png   51.81KB   0 downloads

 

Samsung S8:

Attached File  Screenshot_20190912-203001_World Builder.jpg   85.17KB   0 downloads

 

--config.lua
application = {
    content = {
        width = 1080,
        height = 1920, 
        scale = "letterbox",
        fps = 30,
    }
}

 



[TOPIC: post.html]
#2

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 475 posts
  • Corona SDK

Hmm. That's definitely not supposed to happen! Leave it with me - we have an S8 to test on so I should be able to replicate.

[TOPIC: post.html]
#3

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 475 posts
  • Corona SDK

Sorry, I've not been able to replicate this on an S8 using portrait orientation and the same 1080x1920 letterbox config as you. For me, it's working properly.

 

Looking at your screenshot again, I'm wondering if it's actually your tilemap that's not quite right. If you're using a spritesheet of say... 256x1024 px sprites and your actual tiles are 256x128 px in size, then Qiso basically sets the origin of those 256x1024 sprites to be 128x960, i.e. 64px from the bottom of the sprite (the middle of the 128px tall tile). Therefore if you're drawing the tile graphic at the top of that sprite area instead of at the bottom, it'll render higher up than it's supposed to.

 

The easiest way to tell if your sprites are correct is probably to load a world of only 1 tile, and then qiso.goTo() that tile to centre the camera on it. The tile should appear exactly in the centre of the screen both horizontally and vertically.



[TOPIC: post.html]
#4

J@V0

[GLOBAL: userInfoPane.html]
J@V0
  • Enthusiast

  • 93 posts
  • Corona SDK

I've done the test you mentioned and the tile is pretty much centered (I used qiso.goTo(1,1) )

 

In my case, my tile is 128x72 and I only have this tile in the tileset (for now). Does that mean that the origin will be set at 128x36 ? Do I need to expand the image vertically so it is 128x144?

Attached Files



[TOPIC: post.html]
#5

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 475 posts
  • Corona SDK

Nope, your sprite can be any height that you like. Qiso uses the width to figure out the vertical origin. For 128px wide sprites the tiles centre will always be 32px from the bottom of your canvas, giving you infinite vertical space to add height extending upwards from the tile base.

Your crosshair in that screenshot is actually exactly where it should be, meaning your sprite is correct after all. Those grass blades extend upwards into that infinite space, so they're supposed to be above the crosshair as you've found. The actual diamond of the tile looks to be perfectly in the middle of the screen, so we're good there.

Unfortunately this does mean that my previous response was wrong. It's not your tileset, so I'm not sure what it could be now!

Would you mind sending me your project to have a look at please? I think you have my email already, assuming you don't want to attach publicly.

[TOPIC: post.html]
#6

J@V0

[GLOBAL: userInfoPane.html]
J@V0
  • Enthusiast

  • 93 posts
  • Corona SDK

Project sent by email. We'll post the conclusion here once we have figured out what the issue is.



[TOPIC: post.html]
#7

richard11

[GLOBAL: userInfoPane.html]
richard11
  • Contributor

  • 475 posts
  • Corona SDK

To update anybody following this thread - we did indeed find a bug with the off-screen culling and have now resolved. I've just pushed an updated build live so the Corona build servers should pick this up within an hour or so.

 

The issue only affected games displayed in portrait mode and running on devices of certain screen resolutions, but if you're using Qiso within an already released game that's built to be played in portrait, please do compile a new build to pick up the fix. Sorry for any inconvenience there!


  • sporkfin and J@V0 like this

[TOPIC: post.html]
#8

J@V0

[GLOBAL: userInfoPane.html]
J@V0
  • Enthusiast

  • 93 posts
  • Corona SDK

And I can confirm that the problem is fix when re-building the app :)




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: qiso