Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Tileset crumbling — Gideros Forum

Tileset crumbling

YanYan Member
edited May 2017 in Bugs and issues
So, I have a tilemap level that uses standart TileMap.lua and my own Camera.lua based on standart script

Camera code:
function Camera:onEnterFrame()
 
	if self.isPaused or not self.focus then return end
 
        local focusObj = self:getScaledCoord(self.focus)
 
	self.offset.x, self.offset.y = 0, 0
 
	if self.worldW - focusObj.x < self.screenW / 2 then
 
		self.offset.x = -self.worldW + self.screenW
 
	elseif focusObj.x >= self.screenW / 2 then
 
		self.offset.x = -(focusObj.x - self.screenW / 2)
 
	end
 
	if self.worldH - focusObj.y < self.screenH / 2 then
 
		self.offset.y = -self.worldH + self.screenH
 
	elseif focusObj.y >= self.screenH / 2 then
 
		self.offset.y = -(focusObj.y - self.screenH / 2)
 
	end
 
	self:setPosition(self.offset.x, self.offset.y) -- IF I USE THIS I SEE CRISP
	self:setPosition(math.floor(self.offset.x + 0.5), math.floor(self.offset.y + 0.5)) --IF I USE THIS FIX THERE ARE NO CRISP, BUT CAMERA FLOW NOT SMOOTH
My pause background build this func:
function Level:getScreenShot()
 
	local screenShotRender	= RenderTarget.new(appSettings.w, appSettings.h)
	screenShotRender:draw(self)
 
	local screenShot = Bitmap.new(screenShotRender)
	--screenShot:setColorTransform(0.3, 0.3, 0.3, 1)
 
	return screenShot
 
end
You can see gaps between tiles and my tilemap texture doesnt use filtering. Most of times you can see this effect when you moving along level, so I used a fix in my camera code, that solves this problem.

But even when I use the fix above, when I do Pause, I need to render current screen to Image and show as pause background - and on this render target I see crisps, but how and why ?

This bug follows from 2016 version till now. Should to notice, on PC In Gideros PLayer this bug almost never appeared, and than slower device, then often I see this bug. But that still appears on 8core devices, like Lenovo K50-T5 (K3 Note) and RedmiNote 2
vk.com/yan_alex

Comments

  • hgy29hgy29 Maintainer
    Hi @Yan,
    I've been looking through gideros code for something that could explain this issue, and found out that using swap flags may cause this. Is this your case ?
  • YanYan Member
    Hi @Yan,
    I've been looking through gideros code for something that could explain this issue, and found out that using swap flags may cause this. Is this your case ?
    Can you explain what for swap flag, never seen this before ?

    vk.com/yan_alex
  • hgy29hgy29 Maintainer
    @Yan, I stumbled across a similar issue with TileMap (tiles edge artifacts) just now and found out that using a filtered texture causes them in my case.
    Hope this helps...
  • YanYan Member
    @Yan, I stumbled across a similar issue with TileMap (tiles edge artifacts) just now and found out that using a filtered texture causes them in my case.
    Hope this helps...
    Yes, but this aint works, because my tiles already aint filtered, There are some tiny spaces between tiles, looks like position for each tile counted with different integer precision, because when I set float on my camera position this bug goes away.
    vk.com/yan_alex
Sign In or Register to comment.