FBA The Creator

The True Multiplatform PC / PocketPC Opensource Development Tool - Read Only Mode - Kept only for historical purposes - Thank you all ;)
It is currently Thu Aug 13, 2020 10:43 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jul 03, 2008 2:37 pm 
Offline
FBA Startup-Logo Creator
FBA Startup-Logo Creator
User avatar

Joined: Wed Jun 18, 2008 11:40 am
Posts: 100
Location: Brighton, UK
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...

_________________
http://www.boiledsweets.com


Top
   
PostPosted: Thu Jul 03, 2008 2:40 pm 
Offline
FBA Administrator
FBA Administrator
User avatar

Joined: Fri Mar 21, 2008 11:19 pm
Posts: 238
Location: Rome - Italy
Thanks, i'll check this.


Top
   
PostPosted: Thu Jul 03, 2008 2:44 pm 
Offline
FBA Startup-Logo Creator
FBA Startup-Logo Creator
User avatar

Joined: Wed Jun 18, 2008 11:40 am
Posts: 100
Location: Brighton, UK
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!

_________________
http://www.boiledsweets.com


Top
   
PostPosted: Thu Jul 03, 2008 3:47 pm 
Offline
FBA Administrator
FBA Administrator
User avatar

Joined: Fri Mar 21, 2008 11:19 pm
Posts: 238
Location: Rome - Italy
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!


Top
   
PostPosted: Thu Jul 03, 2008 5:46 pm 
Offline
FBA Startup-Logo Creator
FBA Startup-Logo Creator
User avatar

Joined: Wed Jun 18, 2008 11:40 am
Posts: 100
Location: Brighton, UK
That's fixed it!

;)

THANKS!

_________________
http://www.boiledsweets.com


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited