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 Tue Dec 18, 2018 1:08 pm

All times are UTC




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Jun 08, 2009 9:16 pm 
Offline
User avatar

Joined: Sat May 30, 2009 2:57 pm
Posts: 18
Location: Germany Frankonia
--[[
The long brackets comments are very helpfull to temporaly exclude code from execution.
a single space character between -- [[ or -- ]] switches the comment block off
-- ]]
BE AWARE: this line is a comment in the Editor but would be executed in FBA (or LUA)
--]]

Code:
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)
        quit()
end


Insert the "--", "[[" and "]]" into the tutorial 09b gfx.font code as shown above. Then run the app.
:? :?:

_________________
[x] -- Click at the [x] while pressing [SHIFT] + [ALT] + [NUM-LOCK] simultanously.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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