| View previous topic :: View next topic |
| Author |
Message |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sun Aug 22, 2004 6:49 am Post subject: Mac Style Background |
|
|
Hi. Guys
i like to create a Mac Style Background for my About Window
DIALOG ADD,GRADIENT,GRADIENT1,0,0,380,1,white,white
DIALOG ADD,GRADIENT,GRADIENT2,1,0,380,1,$00BCBCBC,$00BCBCBC
DIALOG ADD,GRADIENT,GRADIENT3,2,0,380,1,white,white
DIALOG ADD,GRADIENT,GRADIENT4,3,0,380,1,$00BCBCBC,$00BCBCBC
DIALOG ADD,GRADIENT,GRADIENT5,4,0,380,1,white,white
DIALOG ADD,GRADIENT,GRADIENT6,5,0,380,1,$00BCBCBC,$00BCBCBC
DIALOG ADD,GRADIENT,GRADIENT7,6,0,380,1,white,white
DIALOG ADD,GRADIENT,GRADIENT8,7,0,380,1,$00BCBCBC,$00BCBCBC
DIALOG ADD,GRADIENT,GRADIENT9,8,0,380,1,white,white
DIALOG ADD,GRADIENT,GRADIENT10,9,0,380,1,$00BCBCBC,$00BCBCBC
The full code is much longer then this
Can be this done with shorter code
Thanks
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Aug 22, 2004 10:50 am Post subject: |
|
|
You can make a repeat-until loop to create the lines. Please note that with the example below, I don't use the DIALOG SHOW commando until all lines are drawn, because VDS draws dialog elements fast if it isn't showing the dialog itself...
| Code: | DIALOG CREATE,About,-1,0,380,200
rem Put the maximum height for the background in a variable for easy usage
%%GradientHeight = 200
rem Make the background one big white gradient, so you don't have to use
rem 100 seperate ones.
DIALOG ADD,GRADIENT,GRADIENT1,0,0,380,%%GradientHeight,white,white
%%GradientCounter = 1
repeat
rem Display a grey line
DIALOG ADD,GRADIENT,GRADIENT@succ(%%GradientCounter),%%GradientCounter,0,380,1,$00BCBCBC,$00BCBCBC
rem And add the number 2 to the %%GradiantCounter variable, so it skips the white lines
%%GradientCounter = @fadd(%%GradientCounter,2)
until @greater(%%GradientCounter,%%GradientHeight)
rem And finally, show the dialog
DIALOG SHOW
:Evloop
wait event
goto @event()
:Close
exit |
Btw. next time when you want to show us your VDS code, you put it between the [ vds ] bbcode tags so it gets the nice layout...
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Aug 22, 2004 1:56 pm Post subject: |
|
|
Please post in the VDS 4 Source Code section if you have full working code.
This post is better suited in General Help.
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sun Aug 22, 2004 4:45 pm Post subject: Thanks Gays |
|
|
Thanks guys
But i wont use this code is not 100% stable when i move window
There is 3 ways using Mac Style background:
Yours
or
With multi lines of Gradient
or
With Bitmap pic
I was runing MacOS x on my PC with PearPC.
Very funny OS and the most Complete LINUX/UNIX OS i have ever try.
BYE for now...
|
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sun Aug 22, 2004 5:37 pm Post subject: Monitor test utility |
|
|
The code from Skit3000
this can be use to build a fine monitor test util
bye
|
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sun Aug 22, 2004 6:47 pm Post subject: |
|
|
Ummm, why are you using a GRADIENT element? I would have suggested
using the SHAPE element instead.
-Garrett
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Mon Aug 23, 2004 1:06 pm Post subject: |
|
|
I recently tried to get a look like the new Mac interface. (iTunes, etc.) I used a bitmap for the "brushed aluminum" look. I'll attach a zipped sample. I also have a larger "piece" that is 800x600 pixels. If anyone needs it, let me know.
| Description: |
|
 Download |
| Filename: |
brushed2.zip |
| Filesize: |
2.93 KB |
| Downloaded: |
1239 Time(s) |
_________________ Joe Floyd |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Aug 23, 2004 2:12 pm Post subject: |
|
|
| Garrett wrote: | Ummm, why are you using a GRADIENT element? I would have suggested
using the SHAPE element instead.
-Garrett |
Also I would not have used @fadd. There is more overhead using a floating point addition than to just use @sum. That is if speed is what you are looking for? Here is an example of what me and Garrett is talking about.
| Code: | DIALOG CREATE,About,-1,0,380,200
rem Put the maximum height for the background in a variable for easy usage
%%GradientHeight = @DLGPOS(,H)
rem Make the background one big white gradient, so you don't have to use
rem 100 seperate ones.
DIALOG ADD,SHAPE,SHAPE1,0,0,380,%%GradientHeight,white,white,,INVISIBLE
REM DIALOG ADD,LINE,LINE
%%GradientCounter = 2
repeat
rem Display a grey line
REM DIALOG ADD,GRADIENT,GRADIENT@succ(%%GradientCounter),%%GradientCounter,0,380,1,$00BCBCBC,$00BCBCBC
DIALOG ADD,SHAPE,SHAPE%%GradientCounter,%%GradientCounter,0,380,1,$00BCBCBC,$00BCBCBC,,INVISIBLE
rem And add the number 2 to the %%GradiantCounter variable, so it skips the white lines
%%GradientCounter = @succ(@succ(%%GradientCounter))
until @greater(%%GradientCounter,%%GradientHeight)
DIALOG Add,TEXT,TEXT1,10,10,,,This is a really good test.@cr()And so is this line.@cr()Now another line.
rem And finally, show the dialog
DIALOG SHOW
:Evloop
wait event
goto @event()
:Close
exit
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Aug 23, 2004 7:42 pm Post subject: |
|
|
I meant to use the SHAPE in the loop. He was using gradients only with
a single color in the loop. The first gradient was fine, as it gave the effect
I believe he was looking for.
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|