Graphical Glitch
Displaying 1-7 of 7 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Allan

Okay, I'm trying to like put a blinking cursor thing in the intro of my game but it leaves an afterimage after I draw over it. Here is the code. Tell me if I should do something different. Any suggestions would be helpful.

Void Intro()
{
int i;
For(i = 0; i



Posted on 2000-11-18 15:01:02

Allan

I guess its cos of the less than greater than operators being html tags.
Void Intro()
{
int i;
For(i = 0; i less than 5; i++)
{
Render();

RectFill(0, 0, screenx-1, screeny-1, 0);
GotoXY(100, 100); PrintString(rgb(0,0,0), "|");
Wait(150);
GotoXY(100, 100); PrintString(rgb(255,255,255), "|");
Wait(150);

ShowPage();
UpdateControls();
}
Exit("This has been a test");
}



Posted on 2000-11-18 15:04:23

andy

Is this being executed in AutoExec?

There is no map to render at that point, so Render() does nothing. If you want to clear the screen, use RectFill(0,0,screenx-1,screeny-1,0); instead.



'What you get by achieving your goals is not as important as what you become by achieving your goals.' -Zig Ziglar

Posted on 2000-11-18 15:25:37

Allan

Yeah, I guess its being done in AutoExec...meaning that no map is loaded yet. So I took out the useless Render() and I'm already using RectFill(0, 0, screenx-1, screeny-1, 0); to clear the screen.

Okay, I feel stupid. I just realised that PrintString(); takes the form of PrintString(int font, string text) and not color, text. Sigh...



Posted on 2000-11-18 17:58:12

Hatchet

You can just use images instead, of use font subsets to get the colors you want. However, the way that was written it wouldn't display correctly anyways, unless Wait has a showpage inside it. Because as it's written, you're drawing the first, waiting, then drawing the second on top, then finally showing what you drew with showpage.

Also, that's probably not the best way to implement a cursor, because it will take the user 3 seconds after a keypress to finally move the cursor. Here's what I would do:

if(timer



-Hatchet

Posted on 2000-11-19 15:36:08

Hatchet

Stupid boards... ;)

Lemmie try that again:

if(timer < 150) DrawFirstCursor();
else if(timer < 300) DrawSecondCursor();
else timer=0;
ShowPage();

that should work much better.





-Hatchet

Posted on 2000-11-19 15:37:48

Allan

Actually, its not supposed to be a functioning cursor but thanks anyway.
Oh, and Wait does have a Showpage(); in it so I guess the one in the code I posted is kinda useless...



Posted on 2000-11-20 16:27:41


Displaying 1-7 of 7 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.