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
Comments
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 ?
Hope this helps...