forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Mac Style Background

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Aug 22, 2004 6:49 am    Post subject: Mac Style Background Reply with quote

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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Aug 22, 2004 10:50 am    Post subject: Reply with quote

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... Smile

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... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Aug 22, 2004 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Aug 22, 2004 4:45 pm    Post subject: Thanks Gays Reply with quote

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
View user's profile Send private message Send e-mail
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Aug 22, 2004 5:37 pm    Post subject: Monitor test utility Reply with quote

The code from Skit3000

this can be use to build a fine monitor test util

bye
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Aug 22, 2004 6:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Mon Aug 23, 2004 1:06 pm    Post subject: Reply with quote

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.


brushed2.zip
 Description:

Download
 Filename:  brushed2.zip
 Filesize:  2.93 KB
 Downloaded:  1239 Time(s)


_________________
Joe Floyd
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Aug 23, 2004 2:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Aug 23, 2004 7:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group