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.

DarkBASIC Discussion / making a scroll bar to scroll through text

Author
Message
Hell Forged Angel
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 3rd Jan 2003 19:22
ok heres the problem,
im making a text based rpg (lame i know but i cant get any models to make decent games). My game seems to work fine but i have to "cls" every so often so you can so the text it is printing. I want to be able to make a scroll bar so that when text gets to the bottom of the screen the screen moves down but you can scroll up to see all the stuff in the past.
Darkness will claim us all
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 3rd Jan 2003 22:46
You could try using a sprite and doing a "Fake Scroll" In this I mean by increasing the height of the sprite on the Y axis, you decrease the texts Y variable.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 4th Jan 2003 00:30
You could store all the text in an array, and only print a part of it to screen, by default the most recent part, but you could scroll up and down.

Here's a sample:


You'd put whatever the player typed and the result into the next available space in the array. If the array is full, then start moving everything up to accommodate, but that would mean deleting some text. To compensate, have a bigger array.
Hell Forged Angel
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 21st Apr 2003 20:18
thx for the help im not quite sue what you mean RPGamer tho but ill read up on sprites see if i can figure it out myself

Darkness will claim us all
Armeggadon
22
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 22nd Apr 2003 00:09
lol hit banana with an axe. yah i had that question a while back also but nobody answered. so thx for helping him with it.

Current Status: small FPS project for a friend(if it looks good in the end may become a demo)
I consider myself: newb
k0shi
22
Years of Service
User Offline
Joined: 30th Dec 2002
Location: Cyberspace
Posted: 22nd Apr 2003 01:48
i made a scroll bar snipt too:

im the only one thats normal in this world.
everyone else is weird.
Hell Forged Angel
22
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 22nd Apr 2003 21:48
thx for posting the source code i dont have time to look at it at the mo but i will later

Darkness will claim us all

Login to post a reply

Server time is: 2025-05-16 11:18:37
Your offset time is: 2025-05-16 11:18:37