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 / Manipulate(move) raw text on screen

Author
Message
fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 25th Jul 2008 22:32
Well I have settled on a game concept and have worked out the game play mechanics. I was day dreaming on my way home from work and imagined a fancy intro screen for the game.

Now the problem I'm trying to tackle is how to make the letters that compose the game title fly in from multiple directions and assemble together in the center of the screen?

Is it possible to manipulate raw text or do I have to create individual sprites for each letter?

Or is there some other fancy techno cheat to pull this off?

Thanks for taking the time to answer this question
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 26th Jul 2008 16:52
Hi. In order to do that you would need to handle each letter of the text using a different TEXT command (at least while they're moving to their target position). I'd put each letter in an array, and then use the CURVEVALUE command to smoothly move them to their target position. I've put together an example of that here. If you don't understand something, feel free to ask and I'll get back to you if I can:



Good luck

fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 26th Jul 2008 23:30
Great this is exactly the kind of thing I wanted to do!

Well I did have a question about the gosub command. Does the gosub only execute once by default unlike a function where it continously runs each cycle?

Thank you!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Jul 2008 00:07
Quote: "Does the gosub only execute once by default unlike a function where it continously runs each cycle?"


Gosubs don't execute once and functions don't run continuously each cycle 'by default'. They actually work in exactly the same way - only as and when called.

However, they do have subtle differences which are covered in tutorials 2 and 6 here:

http://forum.thegamecreators.com/?m=forum_view&b=10&t=99497&p=0

TDK_Man

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 27th Jul 2008 00:39 Edited at: 27th Jul 2008 00:41
You're welcome . I'm glad it helped.

Quote: "Does the gosub only execute once by default unlike a function where it continously runs each cycle?"


As TDK said, there's no "default" way for a GOSUB to behave. It all depends on where in your code call the gosub. If you call it someplace that only gets run once (ex. at the top of your program or something) then the gosub will only run once. If you call it in a loop, then the gosub will run over and over again, just like anything else you put in a loop.

In the case of the example I just gave you, I called the GOSUB in a loop.

fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 28th Jul 2008 04:04
Well I understand the loop and that anything placed in it runs every cycle but I was wondering how the compiler handles the gosub after the letters center on screen. Because once they hit the target position they don't move any further.

So would it be beneficial to wrap a flag around the gosub routine so the program stops trying to execute the gosub statement maybe freeing up processor time? Or is the process so minute that it barely slows the program down?
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Jul 2008 21:45
Quote: "So would it be beneficial to wrap a flag around the gosub routine so the program stops trying to execute the gosub statement maybe freeing up processor time? Or is the process so minute that it barely slows the program down? "


It would probably be beneficial, yes (due to the slowness of the TEXT command). You could flag the gosub and stop calling it once the letters had stopped moving, and then just print the text at the target position normally. This way you have only one text command running at the end instead of several.

Quote: "rem It could be optimized, but it works "

Your point is pretty much what I meant when I wrote this comment, but I tried to keep it simple and wasn't sure if adding that bit would be confusing or not

fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 30th Jul 2008 02:16
Wow yes didn't even think you still had to print the letters because I naturally assumed they will just stay there

OFF TOPIC.

I have run into a situation which to this day still makes me less confident about DBpro. I'm not saying it is the software, it's probably just me.

Why it is that the {color backdrop 0} command fails to work even though the code works without errors? I mean it will work for a while but after adding more code it will stop functioning and the screen will go back to default blue. I don't have code for an example but just about any attempt I make at coding a simple scene with a moving primitive and plain will cause it to occur.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Jul 2008 05:39 Edited at: 30th Jul 2008 05:40
That's a strange problem... It's never happened to me before. Maybe the AUTOCAM OFF command will fix the problem? Yeah I'm probably way off. Anyway, does this code I've posted keep the screen black? Yes, I know it's kinda random but I wanted to make a bunch of stuff happening to see if it triggered your backdrop issue:



fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 30th Jul 2008 14:03
Nope runs fine with black screen though I hade to change the part where you move the camera left to just move camera. But I think you may have solved my problem with autocam off as this may be something I accidently left out of my various testing trials.

You know I was just thinking how amazing it is to achieve so much with very little code in DBPRO. I was actually suprised when I ran the code and saw all those primitives moving around LOL!

Off topic again

I was just thinking how easy it is to lose sight of a project taking into account all the various tools there is out there to help create a game. I'm torn between 3D and 2D and I'm trying to get a grip.

I made the big mistake of downloading Blender because I really like the power of being able to create models from scratch. But the learning curve is tremedous and will take time for me to feel comfortable with it.

My intention was to start with a 2D game but with all the bells and whistles 3D offers I just don't have a clue how to begin because I can't make up my mind!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Jul 2008 15:20 Edited at: 30th Jul 2008 15:21
Quote: "You know I was just thinking how amazing it is to achieve so much with very little code in DBPRO. I was actually suprised when I ran the code and saw all those primitives moving around LOL!"

And that's one reason why I like DBPro .



Quote: "Wow yes didn't even think you still had to print the letters because I naturally assumed they will just stay there "


I've found that the text seems to stay if the backdrop isn't on


Quote: "My intention was to start with a 2D game but with all the bells and whistles 3D offers I just don't have a clue how to begin because I can't make up my mind! "

I'd search "2D or 3D" or something like that on the forums. You can read the threads that pop up, and decide which one you like best . Personally, I started with 3D and enjoyed that the most. But really, read up on the two and decide which one you think would be best to start with.

Move Camera Left didn't work? Hmm, maybe it was a plugin or something that had that command. I thought it looked like I hadn't used it before... Sorry about that

fhtughryf
16
Years of Service
User Offline
Joined: 1st Jul 2008
Location:
Posted: 30th Jul 2008 22:45
Anyways I have decided to stick with 2D for now because I need to get stared here with my project before I totally lose sight.

3D can wait for now no need to rush this I have a lot of time to move up.


Thanks for the time you have taken with me and yes it was helpful.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Jul 2008 23:22
You're welcome. Good luck!

Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 31st Jul 2008 00:46
Hasn't the color backdrop command been deprecated? I've read that somewhere, just don't know where.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 31st Jul 2008 01:02
Quote: "Hasn't the color backdrop command been deprecated?"

Wasn't that scroll backdrop? Color backdrop works fine for me.

Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 31st Jul 2008 01:29
Works fine for me too. I could be wrong. Maybe it was the other. Hmmm...
Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 1st Aug 2008 06:51
Quote: "This command will scroll the 3D backdrop using the specified X and Y scroll values. This command is now obsolete and using sky spheres and boxes is a recommended alternative. "


Both texture backdrop and color backdrop still work.
Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 1st Aug 2008 17:33
Why label them as obsolete if they are going to continue to enable them?
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2008 18:07
Quote: "Both texture backdrop and color backdrop still work. "

But not scroll backdrop, which that help file exerpt is taken from

Login to post a reply

Server time is: 2024-11-24 22:46:58
Your offset time is: 2024-11-24 22:46:58