FBA The Creator
http://www.fbacreator.com/fbaforum/

BUG : destroygfxtext function
http://www.fbacreator.com/fbaforum/viewtopic.php?f=2&t=87
Page 1 of 1

Author:  Boiled Sweets [ Thu Jul 03, 2008 2:37 pm ]
Post subject:  BUG : destroygfxtext function

Hi, try this...

Code:
--------------------------------------------------- 
-- FBA Tutorials
--
-- Tutorial / 09b / Gfx Font
--
---------------------------------------------------
--
-- In this sample, you can see how to use a cool gfx font
-- inside your FBA program.
--
-- Font made by Boiled Sweets (many thanks :))
---------------------------------------------------

-- load our graphic font
image = loadimage("nums.png")
font = loadgfxfont(image, "0123456789", 10)
count = 0

function onmainloop()
        clear(0,0,0)
       
        -- draw counter
        drawgfxtext(font, 10, 10, count)
       
        -- get text width and draw a number aligned to right
        width = gfxtextwidth(font, 9)       
        drawgfxtext(font, screenwidth() - width , 200, 9)

        -- get text width and draw a number aligned to center
        width = gfxtextwidth(font, 69)       
        drawgfxtext(font, screenwidth()/2 - width/2 , 100, 69)
       
        count = count + 1
       
end

function onstylusdown(x,y)
        destroygfxtext(font)
        quit()
end


Get an error when trying to destroy the font...

Author:  evilmaio [ Thu Jul 03, 2008 2:40 pm ]
Post subject:  Re: BUG : destroygfxtext function

Thanks, i'll check this.

Author:  Boiled Sweets [ Thu Jul 03, 2008 2:44 pm ]
Post subject:  Re: BUG : destroygfxtext function

If fact there is something other amiss around this area cos the IDE crashes when my app exits too! :cry: :cry: :cry:

I load all my menu resources, the menu then unload them
Then load all the game resources, do the game then unload them
Then load the menu etc...

Works fine if I do "menu, game, menu, game, menu, exit" but if I try "menu, game, menu, exit" it crashes!!!!!!!!!

Commented out all references to loading and destroying gfx fonts - works fine!

Author:  evilmaio [ Thu Jul 03, 2008 3:47 pm ]
Post subject:  Re: BUG : destroygfxtext function

Ok, there was a little bug inside font free functions. Can you check latest version (0.2.0.116), it should be fixed now...

Thanks!

Author:  Boiled Sweets [ Thu Jul 03, 2008 5:46 pm ]
Post subject:  Re: BUG : destroygfxtext function

That's fixed it!

;)

THANKS!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/