How scroll bar??

Non-platform specific questions.

How scroll bar??

Postby Troodon » Mon Apr 09, 2007 5:31 pm

Hi,
I haven't found out yet, how you guys make those scroll bars which affect to variables? I've tried different things, but nothing seems to work. :/
And how you limit their moving in a small area?
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Mon Apr 09, 2007 6:41 pm

1. what is the range of the variable you want?
2. what is the limit x, and y, you want the actor to move in?
3. is it a verticle scrolling bar, or is it a horizontal scrolling bar?
4. does it move with a window you can drag?
:D
yes, you can do that.
please answer my questions and I can tell you what to do. :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Wed Apr 11, 2007 2:12 pm

Thanks Sparky :D
1.The range is from a to b (for example 0-100)
2.From x1 to x2 or from y1 to y2
3.I'd need both vertical and horizontal
4.I drag an actor with mouse
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Thu Apr 12, 2007 12:02 am

for the mouse button down event drag enabled,
Code: Select all
y = yprevious;//or y = what you want it to be.
if(x < 0)x = 0;
if(x > 100)x = 100;
myVar = x *2.5;

that is for the horizontal version,
here is verticle,
Code: Select all
x = xprevious;//or x = what you want it to be.
if(y < -100)y = -100;
if(y > 0)y = 0;
myVar = -y *2.5;

:)
I hope that helps!
:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Sat Apr 14, 2007 10:36 am

Wait,
I made like this:
y = yprevious;
if(x < 0)x = 0;
if(x > 100)x = 100;
kuva.r = x *1;


and it's quite buggy. Maybe you could give that code with example numbers.
For example my button actor should move only vertically and in the one specified area. Then it should change for example the classic colour variable 'r' so that max left is 0 and max right is 255.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Sat Apr 14, 2007 6:13 pm

erm, that code is wrong for the horizontal thingie I gave you. :(
use this for verticle of a moving range of 0 to 255, and a variable range from 0 to 255:
Code: Select all
xscreen = what-you-want-it-to-be;
if(yscreen < 25)yscreen = 25;
if(yscreen > 280)yscreen = 280;
kruva.r = yscreen - 25;

use this for a verticle moving range of 0 to 100, and a variable range from 0 to 255:
Code: Select all
xscreen = what-you-want-it-to-be;
if(yscreen < 25)yscreen = 25;
if(yscreen > 280)yscreen = 280;
kruva.r = (yscreen*2.5) - 25;

:D
I hope that helps,
here is a version of it where you can change one variable on the create actor event to a different number to change location without modifying your code, first you must make a variable called MIN_YSCREEN and one called XSCR_POS, then use this here,
draw actor event:
Code: Select all
xscreen = XSCR_POS;
if(yscreen < MIN_YSCREEN)yscreen = MIN_YSCREEN;
if(yscreen > MIN_YSCREEN + 100)yscreen = MIN_YSCREEN + 100;
kruva.r = (yscreen*2.5) - MIN_YSCREEN;

and here is for create actor event:
Code: Select all
XSCR_POS = what-you-want-it-to-be;
MIN_YSCREEN = what-you-want-the-minimum-yscreen-limit-to-be;

:D
I hope that helps. :)
EDIT: you said max left and max right
and you also said verticle...?
so I just gave you the verticle code,
you can change it around to make it horizontal. :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Sat Apr 14, 2007 7:05 pm

I can't make it work like it should. Maybe there is something I don't understand in english. Btw in my last post I messed vertical and horizontal. :oops:
My scroll bar should be horizontal. However, when you have time, can you make me one example ged file? Thanks.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Sun Apr 15, 2007 7:24 pm

just send me yours, I am workin' on ANSI C compiling right now with another program(I am still going to use GE do not worry!)
but I will be able to find time :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Sun Apr 15, 2007 7:35 pm

Thanks, I will send you my file as soon as I get to my computer. 8)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Troodon » Mon Apr 16, 2007 1:46 pm

Sparky, I am on my computer and here is my scroll bar example.
Attachments
ScrollBar.zip
More info you can find in the draw actor -&gt; comment.
(241.83 KiB) Downloaded 161 times
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Tue Apr 17, 2007 1:34 am

I will open it up in just a few mins(busy) :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Tue Apr 17, 2007 4:32 pm

Ok, no problem. :D
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Tue Apr 17, 2007 5:52 pm

Code: Select all
y = palkki.y - height / 2;
population = (x + 100) * 5;
if(x < -100)x = -100;
if(x > 100)x = 100;

put that in the draw actor event of nappi.
on the mouse button down event with drag enables just use
Code: Select all
;

:D
you may need to change the pakki animation,
I started it with using width and stuff and x positions but it did not work.
the number I had to use to calculate it was: 3.086419753... ect.
infinitely repeating the 086419753 again and again.
try making the pakki animation 215x25 instead of 325x125
:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Fri Apr 20, 2007 3:33 am

Thanks, I'll try that right now! :D

By the way, I forgot to mention that the pakki animation is made with tiles, so you could have changed it if you wanted. :wink:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Fri Apr 20, 2007 3:36 am

xD
okay
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest