xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> A Fade Effect, Maybe a a saver script possibilty
flattspott
post Oct 1 2004, 04:36 AM
Post #1


X-S Freak
*****

Group: Moderator
Posts: 1787
Joined: 14-April 03
From: Southern California
Member No.: 32293
Xbox Version: v1.0
360 version: v1 (xenon)



CODE
// FadeEffect

MinimumBuild 1230
Gosub Start

:Loop
SetFunc Input IQPeekMsgID
If %Input% != "" Gosub InputHandler
Gosub DrawEffect
Gosub GetFade
Sub Intensity 4
Goto Loop

:InputHandler
IQWaitMsg Any
If %MSG_ID% == UI_BACK Then
Quit
Else
BeginDraw
 Text 320 250 Center "Fade Effect by flattspott" Red
EndDraw
IQClear
IQWaitMsg Any
EndIf
Return

:Start
Set Intensity 255
Gosub GetColors
Gosub GetBoxes
Return

:GetColors
For J = 0 To 5
For I = 0 To 2
 SetFunc ColorPart%I% CvtToBase 16 2 %($rand%255)%
Next
Set Color%J% %ColorPart0%%ColorPart1%%ColorPart2%
Next
Return

:GetFade
If# %Intensity% <= 0 Then
Gosub Start
Else
SetFunc Fade CvtToBase 16 2 %Intensity%
EndIf
Return

:GetBoxes
For X = 0 To 5
Set BoxLeft%X% %($rand%640)%
Set BoxTop%X% %($rand%480)%
Set BoxHeight%X% %($rand%480)%
Set BoxWidth%X% %($rand%640)%
Next
Return

:DrawEffect
BeginDraw
Box %BoxLeft0% %BoxTop0% %BoxHeight0% %BoxWidth0% 0x%Fade%%Color0% 0x%Fade%%Color0%
Box %BoxLeft1% %BoxTop1% %BoxHeight1% %BoxWidth1% 0x%Fade%%Color1% 0x%Fade%%Color1%
Box %BoxLeft2% %BoxTop2% %BoxHeight2% %BoxWidth2% 0x%Fade%%Color2% 0x%Fade%%Color2%
Box %BoxLeft3% %BoxTop3% %BoxHeight3% %BoxWidth3% 0x%Fade%%Color3% 0x%Fade%%Color3%
Box %BoxLeft4% %BoxTop4% %BoxHeight4% %BoxWidth4% 0x%Fade%%Color4% 0x%Fade%%Color4%
Box %BoxLeft5% %BoxTop5% %BoxHeight5% %BoxWidth5% 0x%Fade%%Color5% 0x%Fade%%Color5%
EndDraw
Return
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
SumDumGuy3
post Oct 1 2004, 08:03 AM
Post #2


X-S Young Member
*

Group: Members
Posts: 53
Joined: 10-August 04
Member No.: 137432



Well, I am trying to learn so I took the opportunity to monkey around with your script for a few minutes... Here is what I came up with...

CODE
// FadeEffect In & Out

MinimumBuild 1230
Set SwitchFades 0
Gosub GetColorsOut
Gosub GetBoxesOut
Gosub Start

:Loop
SetFunc Input IQPeekMsgID
If %Input% != "" Gosub InputHandler
Gosub DrawEffect
Gosub GetFade
Goto Loop

:InputHandler
IQWaitMsg Any
If %MSG_ID% == UI_BACK Then
EndDraw
Quit
Else
BeginDraw
Text 320 250 Center "Fade Effect by flattspott (w/slight change by SumDumGuy)" Red
EndDraw
IQClear
IQWaitMsg Any
EndIf
Return

:Start
If# %SwitchFades% == 1 Then
Set IntensityOut 0
Set IntensityIn 255
Gosub GetColorsOut
Gosub GetBoxesOut
Else
Set IntensityOut 255
Set IntensityIn 0
Set SwitchFades 0
Gosub GetColorsIn
Gosub GetBoxesIn
EndIf
Return

:GetColorsIn
For J = 0 To 2
For I = 0 To 2
SetFunc ColorPart%I% CvtToBase 16 2 %($rand%255)%
Next
Set Color%J% %ColorPart0%%ColorPart1%%ColorPart2%
Next
Return

:GetColorsOut
For J = 3 To 5
For I = 0 To 2
SetFunc ColorPart%I% CvtToBase 16 2 %($rand%255)%
Next
Set Color%J% %ColorPart0%%ColorPart1%%ColorPart2%
Next
Return

:GetFade
If# %IntensityOut% <= 0 Then
Set SwitchFades 1
GoSub Start
EndIf
If# %IntensityOut% >= 255 Then
Set SwitchFades 0
GoSub Start
EndIf
If# %SwitchFades% == 0 Then
Sub IntensityOut 4
Add IntensityIn 4
Else
Add IntensityOut 4
Sub IntensityIn 4
EndIf
SetFunc FadeOut CvtToBase 16 2 %IntensityOut%
SetFunc FadeIn CvtToBase 16 2 %IntensityIn%
Return

:GetBoxesIn
For X = 0 To 2
Set BoxLeft%X% %($rand%640)%
Set BoxTop%X% %($rand%480)%
Set BoxHeight%X% %($rand%480)%
Set BoxWidth%X% %($rand%640)%
Next
Return

:GetBoxesOut
For X = 3 To 5
Set BoxLeft%X% %($rand%640)%
Set BoxTop%X% %($rand%480)%
Set BoxHeight%X% %($rand%480)%
Set BoxWidth%X% %($rand%640)%
Next
Return

:DrawEffect
BeginDraw
Box %BoxLeft0% %BoxTop0% %BoxHeight0% %BoxWidth0% 0x%FadeIn%%Color0% 0x%FadeIn%%Color0%
Box %BoxLeft1% %BoxTop1% %BoxHeight1% %BoxWidth1% 0x%FadeOut%%Color1% 0x%FadeOut%%Color1%
Box %BoxLeft2% %BoxTop2% %BoxHeight2% %BoxWidth2% 0x%FadeIn%%Color2% 0x%FadeIn%%Color2%
Box %BoxLeft3% %BoxTop3% %BoxHeight3% %BoxWidth3% 0x%FadeOut%%Color3% 0x%FadeOut%%Color3%
Box %BoxLeft4% %BoxTop4% %BoxHeight4% %BoxWidth4% 0x%FadeIn%%Color4% 0x%FadeIn%%Color4%
Box %BoxLeft5% %BoxTop5% %BoxHeight5% %BoxWidth5% 0x%FadeOut%%Color5% 0x%FadeOut%%Color5%
EndDraw
Return


Basically, the only thing I did was break it down so that half of the boxes are fading out while the other boxes are fading in. Any given box is not randomly regenerated until it has faded all the way in and then all of the way back out. so each box appears to fade in and then fade out then a new box is created in that ones place. The idea was for it to look like it had no begining and no end. just seamlessly fading from one set of boxes to another. However, it did not work quite according to plan... there is an annoying flash/flicker each time it switches the fade effect. It is like all of the boxes flash white when they hit their peak intensity as well as at their minimum intensity? I have no idea what I have done wrong to accomplish that? But anyway, I just wanted to mess around for a minute... Now, I have really got to get some work done and get to bed...

SDG
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 19th May 2013 - 11:25 AM