Discord
Login
Community
DARK THEME

Does "isFontReady()" work?

Hi! Maybe anybody can help me with screen.isFontReady() ... this does not seem to work for me. See my code below. The word "screen" is written several times on the screen, first in default-font, after 5 times in the fontName-font. But it should not have been drawn at all before it would have been "FontReady", is this correct?

Thank you! Kristian

init = function() fontName="paper_cutout" asset_manager.loadFont(fontName) image = new Image(50,50) y=-100 end

update = function() end

draw = function() y+=10 if screen.isFontReady(fontName) then screen.setFont(fontName) screen.drawText("screen",-50,y,20,"rgb(200,0,0)") end end

screen.isFontReady( fontname ) this checks if its ready so all it does is return 1 or 0 so you just do an if statement waiting for it to be 1

an example is

if screen.isFontReady( fontname ) then
   //do something
end

Thank you. I thought this would work this way. Here you can see, that this seems not to be the case.

Link to my example: https://microstudio.io/Kristian/fonttest/G8HFDKY6/

screen.isFontReady() seems to be true but afterwards the setFont command is not working and the text appears with the wrong font.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community