Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / text function problem

Author
Message
Phoenix Games
22
Years of Service
User Offline
Joined: 19th Feb 2004
Location:
Posted: 31st May 2004 21:35
i wrote a function to make text fade between colours but infortunately i can't get it working and don't know why, i am new to functions so don't know if i am writing it correctly, it keeps coming up with "Severe Exception" at run-time but not when compiled could someone tell me what's wrong? any replies would be much appreciated - here is the code:
`tS2, true studio 2d
`flip-book animation program
intro:
hide mouse
set display mode 1024, 768, 16
set text size 200
set text font "Dauphin"
ink rgb(55, 55, 255),0
center text 512, 200, "tS2"
sleep 3000
set text size 60
ink rgb(155, 155, 255),0
center text 512, 400, "True Studio 2D"
show mouse

FlashText(512,600,"Press Any Key To Continue")
suspend for key
end

function FlashText(x,y,text$)
fcolor = 0
do

ink rgb(fcolor,fcolor,fcolor),0
center text x, y, flashtext$
if fcolor = 255 then dwn = 1
if fcolor = 0 then dwn = 0
if dwn = 0 then inc fcolor
if dwn = 1 then dec fcolor

loop
p.s. as you may have guessed this is for a 2d animation program i am making, so i think it will be a difficult task. I think i shall put up some team requests shortly so if you're interested check out the team requests section soon.
SandraD
22
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 31st May 2004 22:51
Quote: "center text x, y, flashtext$
"


This is the only error that I see, when you have called the text to be displayed "text$" in the function definition. I *think* it trying to call itself over and over... which crashes out any heap or stack built.

Any truly great code should be indisguishable from magic.
SandraD
22
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 31st May 2004 23:00
Oh wait...

I have another comment. You have a suspend for key after the function call, but no way to exit the loop inside the function! Rather an important point there...

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2026-06-09 15:43:51
Your offset time is: 2026-06-09 15:43:51