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 / scroll bar

Author
Message
sorcre
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: United States
Posted: 13th Jun 2003 04:49
does anyone know a good code that will make a scroll bar?
never achive your goals... cause if you do then what is next????
k0shi
22
Years of Service
User Offline
Joined: 30th Dec 2002
Location: Cyberspace
Posted: 16th Jun 2003 23:53
scrollbar,i didnt think to put remarks on it when i made it, srry.

>> koshi
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Jun 2003 08:15
it will need a few tweaks for DBP but it works just the same

freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 17th Jun 2003 14:45
what do you want to scroll? text or also images?

if you want to scroll text, you can display several lines of text on your screen;

text line1_x-coordinate,line1_y-coordinate,rule$(1)
text line2_x-coordinate,line2_y-coordinate,rule$(2)
text line3_x-coordinate,line3_y-coordinate,rule$(3)
...

and then you make two buttons to scroll (just use the paste image command or commands like box and line if you don't want to use any media), you can check those buttons using the mousex() and mousey() command (to know if the mouse cursor is above a buttons) and the mouseclick() command (to check if the button has been clicked)

so let's say you have read your text to an array text$(), so the first rule of text is in text$(1), the 2nd in text$(2) etc.
in the beginning you assign:
rule$(1)=text$(1)
rule$(2)=text$(2)
...
when (for example) the up scroll button has been pressed, you'll have to do something like this:
rule$(1)=text$(2)
rule$(2)=text$(3)
...
it's only an example but - knowing this - you should be able to code it
note that you can use for - next loops to do those repeated things, and that the values for the for-next loop will have to be variables in the scroll routine

[href]www.bernardfrancois.com[/href]
Ishamael Sedai
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: France
Posted: 1st Jul 2003 23:17
problem...with mousex() mousey() mouseclick()... i didn't manage to do it... had to make a sprite of the mouse...but permitted me to make a drag'n'drop function...
my code that fell
*note : I put "if" sequences instead of "and" *


I am the Betrayer of hope naebl'is by the will of
the Great Lord of the Dark. If you do not want to surrender, your soul will burn in the deepest hole of the Pit of doom.

Login to post a reply

Server time is: 2025-05-19 04:01:15
Your offset time is: 2025-05-19 04:01:15