The text gets scaled “up” to 1.0 in enterFrame() by something like the following
if scale < 1.0 then
scale = scale + 0.25
if scale > 1.0 then
scale = 1.0
end
txt:setReferencePoint(display.CenterReferencePoint)
txt.xScale=scale
txt.yScale=scale
end
The Text is now rendered with strange artifacs on the right side… very hard to describe and it is only visible on the devices (iPhone 3GS / iPod Touch 3G / iPad).
I saw it at first only on the iPad because of its zoom. It looks like as if you see 1 pixel row of garbage … and it seems to appear where the “bounding box” of the rendered letter ends.
This also only happens for bigger font sizes… at least I can’t see it on the smaller fonts.
Again: This only happens when the rotation is set to 180 in the stage.
I am to tired to write a small test program but may tomorrow…
P.S.: It does not happen when I use the native support by a build.settings file [import]uid: 6928 topic_id: 1246 reply_id: 301246[/import]
If you can write a test program that would be fab. Strange artifacts, are they like random noise? [import]uid: 54 topic_id: 1246 reply_id: 3281[/import]
-- Fontrendering Artifacts with scaling (and rotation)
io.output():setvbuf('no')
s=display.getCurrentStage()
s:setReferencePoint(display.CenterReferencePoint)
local txt=display.newText('8',0,0,'MarkerFelt-Thin',64)
txt:setTextColor(180,180,0)
txt.x=s.stageWidth/2
txt.y=s.stageHeight/2
local frame=1
local scale=1.0
local shrink=false
local udown=false
function render()
frame=frame+1
if frame % 60 == 0 then
if shrink then
scale=0.5
else
scale=2.0
end
shrink=not shrink
end
if frame % 200 == 0 then
if udown then
transition.to(s, {time=300, rotation=0})
else
transition.to(s, {time=300, rotation=180})
end
udown=not udown
end
if scale ~= 1.0 then
if scale \> 1.0 then
scale = scale - 0.025
if scale \< 1.0 then
scale = 1.0
end
else -- must be \< 1.0
scale = scale + 0.025
if scale \> 1.0 then
scale = 1.0
end
end
txt:setReferencePoint(display.CenterReferencePoint)
txt.xScale=scale
txt.yScale=scale
end
end
Runtime:addEventListener("enterFrame", render)
This version also shows the artifacts inside of the simulator. This is different in my app which at least seems not do do it. But you may see that it depends on some other stuff like the font, the scaling and of course the rotation!
If you use “Help!” as the string instead of the “8” (my app uses numbers mainly) you will see different even worse artifacts in the simulator… but not on the device i believe.
I tested it on the iPad because it shows the artifacts the best because 2X scaling of iPhone apps.
They are indeed looking like static a bit. I hope this gets resolved… looks really ugly
Hope that helps! [import]uid: 6928 topic_id: 1246 reply_id: 3296[/import]