May 18, 2024, 09:48:46 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Placing a Graduation Tint into a Window

Started by Allan, September 13, 2008, 05:58:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Allan

Graduation Tint - by Allan  (Bizzy)

Here is a small program using Graduation Tinting in Creative Basic Window. I had once done this before in IBStd and it looks quite effective.

The client area of the Screen is filled with a graduating tint. Different combinations can be set in the RGB for different color tints.

Any defined area such as Client Height and Width can be used. For Example the RECT where the text is PRINTed to the Screen could be filled with a Graduation, using the same technique.

Transitions and Effects - also from this method - experiment!


Source Code and explanation on the coding is included in the Zip.

Allan


aurelCB

Very good Allan :)
Your Graduation tint give me idea for one small intro.
Here is code:

'small intro
DEF win:WINDOW
DEF x,y,w,h:INT
DEF rr,gg,bb:INT
DEF run,lx:int
'---------------------------------------------------------
WINDOW win,0,0,300,255,@nocaption|@border,0,"Intro",<class>
SETWINDOWCOLOR win,rgb(231,231,231)
Intro()
Pause()

CLOSEWINDOW win
END
'--------------------------
SUB <class>
SELECT @CLASS
CASE @IDCLOSEWINDOW
run=0
CASE @IDCREATE
CENTERWINDOW win
ENDSELECT
RETURN

SUB Intro
gg=0
bb=0
x=0:w=300:h=5
y=255
For n=0 TO 255 step 1
y=y-1
gg=y:bb=y
Loop()
RECT win, x,n,w,h, RGB(0,gg,bb),RGB(0,gg,bb)
Next n
'------------------------------------
SETFONT win, "Tahoma", 7, 700
DRAWMODE win, @TRANSPARENT
Move win,10,25
FRONTPEN win, RGB(180,80,80)
Print win,"LOADING..."
LINE win,x,36,w,36,rgb(0,gg-140,bb-140)
LINE win,x,24,w,24,rgb(140,gg,bb)
'------------------------------------
RECT win, x+6,150,w-20,h+3, RGB(0,gg,bb)
'--------------------------------------
FRONTPEN win, RGB(180,gg,bb)
FOR lx=8 TO 283
LINE win,lx,152,lx,156,rgb(180,gg,bb)
For px = 1 to 10
Wait px
Signs()
Next px
NEXT lx
RETURN
'-----------------------------------
SUB Loop
For y2=25 to 35 step 1
LINE win,x,y2,w,y2,rgb(20,gg-40,bb)
NEXT y2
Return
'----------------------------------
SUB Pause
'about 5 sec
For pa = 0 to 1000
LINE win,x,256,w,256,rgb(20,gg-40,bb)
wait pa
Next pa
'run=0
Return
'-----------------------------
SUB Signs
SETFONT win, "Tahoma", 12, 700
If lx=8:move win,50,100:print win,"I":Endif
If lx=63:move win,70,100:print win,"N":Endif
If lx=118:move win,90,100:print win,"T":Endif
If lx=173:move win,110,100:print win,"R":Endif
If lx=228:move win,130,100:print win,"O":Endif
Return

Allan

aurelCB that is really neat idea.

Thanks.

Allan

Allan

I have updated the Graduation Tint code so that the TEXT will center on the window when it is resized.

Allan

GWS

Great work guys - those ideas will come in useful for all sorts of projects ..  :)

best wishes,

Graham
Tomorrow may be too late ..

Allan

I added a few more lines to the Graduation Tint to get a special effect when the Window is closed.

It really looks Magic as it fades into the background and finally disappears.

Allan