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 / Slider size calculation

Author
Message
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 12th Apr 2009 23:43
Ok I'm trying to figure out a good way to calculate the size of the slider for my Windows functions. the way i'm doing it is you input the number of "Positions" you havei n the slider and the height. but i don't know how to calculate it with those to things. anyone have any ideas?

New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 12th Apr 2009 23:48 Edited at: 12th Apr 2009 23:56
input positions
input height
interval = height/positions


You mean like that?

Then you can just draw at each interval.

mcz = mousemovez() :`Scroll wheel
if mcz > interval then inc bar_pos,mcz/positions


Is that what you mean?

I'll see if I can throw something together for fun.

That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 12th Apr 2009 23:58
Well what i mean is the size of the actual bar. like this:




New Site! Check it out \/
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 13th Apr 2009 00:06
Ah, I see what you mean. That would have to do with how big the "page" is. What I'm doing in my example for drawing the bar is having the y be like:

box 200,BOX_POS*INTERVAL,220,BOX_POS*INTERVAL+INTERVAL

So I have the length of the bar a single interval length.

That's what they WANT you to think...
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Apr 2009 00:15
hmmm that would work exept what if the interval was tiny? like you had tones of positions? like i figured it (assuming the size of each line in darkedit is 20 pixels) it's about 25650 pixels tall for my 1283 line code. i have a 580 tall area for the slider. that makes each interval 0.23 pixels tall. i don't actually think me or anyone using these function would need that much but still what if someone did? that would be (if you made it a integer) i think it wouldn't work actually cuz with int() function it would round down to zero wouldn't it? lol

oh and btw the size ofthe slider bar in dark edit was the size of 69.blablabla intervals lol i will probly use what you said for now until i find something that will work a little better.

New Site! Check it out \/
Tacho
20
Years of Service
User Offline
Joined: 30th Mar 2005
Location:
Posted: 13th Apr 2009 02:18
just use if/else if the bar gets too small

Tacho
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Apr 2009 05:21
I did it for the Challenge a challenge or two ago. I believe I used percentages. So if a full screen was 1/3 of the total size, then the bar is 1/3 the screen. Make sense?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Apr 2009 08:08
BN2:

Oh! ok i will try this 2morro! i'm tired and have school 2morro lol.



New Site! Check it out \/

Login to post a reply

Server time is: 2025-08-08 20:42:30
Your offset time is: 2025-08-08 20:42:30