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.

Newcomers DBPro Corner / Text problem

Author
Message
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 26th Aug 2004 17:24
Hi, before you ask I have looked in the forums already to look for an answer to my problem but I cant find one that sorts my problem out.
I have a complicated...ish. Do Loop and want to display "Level One" at the middle of the screen at the top. I can do this, but it flashes on the straight back off again. Now this is when I placed it before the do loop. So I tried one of the answers to one of the other forum threads on text(place it at the end of the do loop.
This makes it constantly flash and makes my game lag as though it is going fast until it gets to the text commands. I heard somewhere that the text commands arent very quick if the flashing an effect of this? Can anyone help. basically I want to keep the text at the top of the screen. Thankyou very much.

Daniel.

*For every problem you come across you gain something from correcting it, I hope.
Jacava
20
Years of Service
User Offline
Joined: 1st May 2004
Location: Somewhere. Sometime. Somehow. No Reason.
Posted: 26th Aug 2004 18:19
Place the line elsewhere in the code, not in the loop. If you want it to stay at the top of the screen, then enter it just before. That way the text will stay there throughout the loop unless you have a CLS in there somewhere. I don't know what to do if there is one.

Simple.
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 26th Aug 2004 18:39
I did have it before the loop originally, and no there isnt a CLS. Do you want to look at the source code?
Thankyou
Daniel.

*For every problem you come across you gain something from correcting it, I hope.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Aug 2004 21:32
try this example



If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 27th Aug 2004 00:38
Ok this example works. So I guess its something to do with my code, so I'll post it, be warned its not very tidy but Im in the process of clearing it up. Also levels two and three havent got the textures and havent been changed much yet from the first level.

*For every problem you come across you gain something from correcting it, I hope.
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 27th Aug 2004 00:39
sorry that was the old version code try this.
Thankyou

*For every problem you come across you gain something from correcting it, I hope.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Aug 2004 02:16
In Indi's example, he writes the text every loop. You write it once. In DB Pro, this doesn't work (I think it used to in Classic).

The solution is:

1. Put your end of level text in a loop, and rewrite the delay routine.

2. Write your text to a bitmap (CREATE BITMAP), MAKE IMAGE from the bitmap, SPRITE the image, and put that on the screen.

Option 2 is the better option IMHO. You can write a function that takes in text, and creates a Sprite. It can then be used whenever you want text.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 27th Aug 2004 03:47
So if this is a problem im going to run into everytime I make a game then I should make a function. I shall start to sort one out later, how would you go about doing it. Read in the variable then if the function detects the letter ... then display the sprite repesenting ... on the screen. Right?
Ok so how do I read the values in the variable? I have quickly look in the manual but I dont really know where to look. Thanks
For the function should I give it a parameter(the variable).
Thanks

Daniel.

*For every problem you come across you gain something from correcting it, I hope.
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 27th Aug 2004 04:13
Is this what you mean, it doesnt work though, just a black screen. Any ideas.


*For every problem you come across you gain something from correcting it, I hope.

Login to post a reply

Server time is: 2024-11-27 08:49:24
Your offset time is: 2024-11-27 08:49:24