|
This thread is locked; no one can reply to it. |
1
2
|
Want Text to appear gradually from Left to Right |
HappyBoy
Member #13,462
September 2011
|
In most RPGs, text appears gradually in the textbox from left to right for more fluid reading, but I only know how to output a text fully all at once. Here is an example of what I mean (FF7): http://www.youtube.com/watch?v=k18Jc-O2NT4 How can I display text this way in my game? Thank you. EDIT: I'm using Allegro 4.2.3 |
J-Gamer
Member #12,491
January 2011
|
You would have to draw one extra letter each frame(or every 3 frames or so, to reduce the speed). " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
HappyBoy
Member #13,462
September 2011
|
I'm sorry, I should have said, I'm a super noob. I don't know what you just said. Could you please demonstrate using a simple example? |
J-Gamer
Member #12,491
January 2011
|
nvm " There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo |
alex Ioan
Member #12,015
June 2010
|
It means that if you can't recreate a typewriter text output effect, you need to study game design more
|
HappyBoy
Member #13,462
September 2011
|
To: ALEXAROTH Ya, that's what I'm trying to do here. |
LennyLen
Member #5,313
December 2004
|
HappyBoy said: Ya, that's what I'm trying to do here. Try breaking the problem down into small simple steps, then tell us how you think the problem should be approached. People can give you feedback on that and get you started on your way. Simply asking people to just give you code won't help you learn much.
|
Johan Halmén
Member #1,550
September 2001
|
HappyBoy said: but I only know how to output a text fully all at once. Make your own function. Call it with your string as an argument, plus everything else you need, like colours and coordinates. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
HappyBoy
Member #13,462
September 2011
|
K, no one has been helpful. |
Arthur Kalliokoski
Second in Command
February 2005
|
W They all watch too much MSNBC... they get ideas. |
HappyBoy
Member #13,462
September 2011
|
To: Arthur Kalliokoski A demonstration of a simple example would have been good. |
Arthur Kalliokoski
Second in Command
February 2005
|
They all watch too much MSNBC... they get ideas. |
HappyBoy
Member #13,462
September 2011
|
Thank you, but that just returns Build Error. |
Arthur Kalliokoski
Second in Command
February 2005
|
So you don't know how to use your compiler, either? You need to find some basic "Hello World" tuturial and work your way up to graphical games. Gotta walk before you run and all that. Check this out. http://neuron-ai.tuke.sk/~hudecm/Tutorials/Gaming/www.gametutorials.com/purpose.htm They all watch too much MSNBC... they get ideas. |
Johan Halmén
Member #1,550
September 2001
|
Happy Boy, what can you do? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
HappyBoy
Member #13,462
September 2011
|
I wish I knew why the peers in this community assume that I'm lazy just because I tried and failed then had to ask help. I don't know how to make the text "typewrite" in my Win32 Allegro game and would probably learn by example if I saw a code that actually works. That's all. People here say it's so simple, but no one here can showcase a simple working example, wtf??? So, we need it to be in Win32 Application, display on a graphics screen, and probably looks something like: P.S. this is my working version in Console App, but it doesn't work in Allegro Win32 and doesn't work on a timer (I dunno how to do that just yet): #include <iostream> Dudes, I can do lots of stuff. I'm making an RPG that presently has displayed HP/MP , random damage, string dialogue, sprite cycling, camera scrolling, random battle system, and more. I've made it from scratch and it all compiles and runs in Win32 Application just fine. I can send it to you if you want. |
Matthew Leverton
Supreme Loser
January 1999
|
This is simple, yes. But programming isn't about copy and pasting an example into your own code and expecting it to work. You must learn to figure out how to write code when people explain things to you. Your game should have a timer system that ticks X times per second, controlling the speed of the game. If you don't do that or understand how that works, then you won't understand what we're saying. In fact, once you understand that core principle, every thing like this becomes trivial. char message[1000]; // the message to display piece by piece. int len = 0; // how much to display // every timer tick: len += 1; Now only display up to len characters of the message. Exactly how you do that depends if you use C or C++ or Allegro 5 strings, etc. If your game ticks at 60 times per second, you'll get 60 letters per second with the above message. If you want more fine control, you could easily just change len to a float and change 1 to be higher or lower depending if you want it to be faster or slower. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You can easily do this by setting the clipping rectangle when you draw your text on screen. Simply keep track of how much of the text to show as a percentage or as a number of pixels per second. Use a timer so you know how much time has passed so you know how much to show and set the clipping rectangle accordingly. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Arthur Kalliokoski
Second in Command
February 2005
|
Or if you do expect to copy and paste stuff into a game, just download the Doom or Quake source code, stick your name on it, and tell everyone you wrote a game. They all watch too much MSNBC... they get ideas. |
Matthew Leverton
Supreme Loser
January 1999
|
Edgar Reynaldo said: You can easily do this by setting the clipping rectangle when you draw your text on screen. As you see, this method also relies on timers. There's many different ways to do this... all of them quite simple to implement if you understand how how basic game timing works. |
North~
Member #12,192
August 2010
|
Johan Halmén said: Make your own function. Call it with your string as an argument, plus everything else you need, like colours and coordinates. I'm confused HappyBoy... How is that not helpful? That's the entire answer written out for you clear as the sky on a bright sunny day. If you've truly implemented all of the things in your game that you said you have, this concept should've been so easy, you wouldn't have even had to post here in the first place. -------------------------------------------------- If this is possible if you don't correctly initialize memory, it should be a priority of the highest order. |
bamccaig
Member #7,536
July 2006
|
See Allegro 4 Timers. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
HappyBoy
Member #13,462
September 2011
|
I'm not copy/pasting code into my game. I'm copy/pasting it into a blank Win32 document linked to alleg.lib, because if a code doesn't work in that environment, then it won't work anywhere. Nope, nobody's code here even builds successfully, let alone accomplishes the desired task. I'm guessing that every poster here doesn't even really know how to do it and is too ashamed to admit it, because so far everyone says it's super easy but then can't even execute it faithfully themselves. That'd be like if they said, "I could run a marathon so easily, but I just don't feel like it." I've since got my own way to sorta work, but it's not very efficient to do a whole game this way. Maybe I'll end up teaching everyone here after I polish it up a bit. Hah, now that would be ironic. |
Johan Halmén
Member #1,550
September 2001
|
Nobody's code builds successfully, because they expect you to understand the essential parts in the code and copy them into your application. Arthur's code seems quite ok. But it probably outputs something in the console window, something he posted a bit earlier. Your task is to pick the essential lines from his code into your program. I guess it would be the following lines. srcbuff is a C string containing your text to be output. diffbuff is a C string of same size, which you have allocated. Line 5 is your printing line. Replace it with your textprintf_ex(). And add a line like rest(100); to delay for a 10th of a second. To be able to use strcpy() you have to #include <string.h> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
LennyLen
Member #5,313
December 2004
|
HappyBoy said: I'm guessing that every poster here doesn't even really know how to do it and is too ashamed to admit it Sorry kid, people aren't stupid enough to fall for that one.
|
|
1
2
|