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

drawgfxtext with colour and blending problem
http://www.fbacreator.com/fbaforum/viewtopic.php?f=2&t=94
Page 1 of 1

Author:  Boiled Sweets [ Thu Jul 10, 2008 11:59 am ]
Post subject:  drawgfxtext with colour and blending problem

If you try drawing a gfx font text thats coloured and you have a blend < 255 then it corrupts the text...

For example...

Image

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,2550,0)

        blending(200)
        -- draw counter
        drawgfxtext(font, 10, 10, count, 255,0,0)
       
        -- 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

Author:  evilmaio [ Thu Jul 10, 2008 12:46 pm ]
Post subject:  Re: drawgfxtext with colour and blending problem

Ok i'll check that

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