Geht doch alles und meiner Meinung nach sehr einfach:Was willst du denn dahinter anzeigen?
Da sind doch die farbigen Balken.
Doppelmaskierung geht halt nicht, aber das war ja auch nicht gefragt.
z.B. eine Maske, aus der eine Figur ausgeschnitten ist, die hinter dem Logo, aber vor den farbigen Balken hin und her "wandert". Da müsste man halt direkt auf das Sprite malen, bzw auf Kopien des Sprites.
Code: Alles auswählen
;**************************************************************************************************************************
;* *
;* *
;* *
;* *
;* *
;* *
;* *
;* *
;**************************************************************************************************************************
EnableExplicit
;**************************************************************************************************************************
; Konstanten declarieren
;**************************************************************************************************************************
#ScreenWidth = 1024
#ScreenHeigth = 768
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitSprite3D() = 0 Or InitSound() = 0 Or InitMouse() = 0
MessageRequester( "Error", "Can't open DirectX 7 or later", 0 )
End
EndIf
If OpenScreen( #ScreenWidth, #ScreenHeigth, 32, "Test3D", 0 ) = 0
MessageRequester( "Error", "Can't open Screen", 0 )
End
EndIf
Define Font1.l
Define Font2.l
Font1 = LoadFont(#PB_Any , "Arial", 120, #PB_Font_Bold )
Font2 = LoadFont( #PB_Any,"Arial" , 15, #PB_Font_Bold | #PB_Font_HighQuality )
If Font1 = 0 Or Font2 = 0
MessageRequester( "Error", "Can't load this Font", 0 )
End
EndIf
Global Dim PicSet.l( 5 )
Global i.l
Global Time.f
Global Time2.f
Define r.l
Define Sprite1.l
Define Sprite2.l
Define TextX.f
Define Maske1.l
Define Circle1.l
Define Circle2.l
Define Circle2X.f = -128
;---------------------------- Structuren für die Copper Bars --------------------------------------
Structure Copper
Copper.l
x.f
y.f
Color.c
EndStructure
Global NewList Copper.Copper()
;---------------------------- Structuren für die rumfliegenden Zeichen -----------------------
Structure Pic
Num.l
x.f
y.f
w.l
z.l
Trans.f
Fade.b
EndStructure
Global NewList Pic.Pic()
;---------------------------- Copper Bars malen --------------------------------------
ClearScreen( 0 )
StartDrawing( ScreenOutput() )
For i = 1 To 20
Line( 0, i, 1024, 1, RGB( 20 + i * 13, 0, 0 ) )
Line( 0, 25 + i, 1024, 1, RGB( 0, 20 + i * 13, 0 ) )
Line( 0, 50 + i, 1024, 1, RGB( 0, 0, 20 + i * 13 ) )
Line( 0, 75 + i, 1024, 1, RGB( 20 + i * 10, 20 , 20 + i * 10 ) )
Line( 0, 100 + i, 1024, 1, RGB( 20, 20 + i * 10, 20 + i * 10 ) )
Line( 0, 125 + i, 1024, 1, RGB( 20 + i * 10, 20 + i * 10, 20 ) )
Next
;---------------------------- Ein paar bunte Zeichen malen --------------------------------------
DrawingMode( #PB_2DDrawing_Outlined | #PB_2DDrawing_Transparent )
DrawingFont( FontID( Font2 ) )
DrawText( 10, 153, "$" , RGB( 180, 0, 0 ) )
DrawText( 42, 153, Chr( 174 ), RGB( $CC,$00,$FF ) )
DrawText( 74, 153, Chr( 182 ), RGB( $66, $00, $FF ) )
DrawText( 106, 153, Chr( 164 ), RGB( $FF, $FF, $66 ) )
DrawText( 138, 153, Chr( 188 ), RGB( $33, $33, $FF ) )
DrawText( 170, 154, Chr( 177 ), RGB( $00, $CC, $33 ) )
StopDrawing()
For i = 0 To 5
PicSet( i ) = GrabSprite( #PB_Any, i * 32, 150, 32, 32, #PB_Sprite_Texture )
PicSet( i ) = CreateSprite3D( #PB_Any, PicSet( i ) )
Next
For i = 0 To 5
AddElement( Copper() )
Copper()\Copper = GrabSprite( #PB_Any, 0, i * 25, 1024, 20, #PB_Sprite_Texture )
Copper()\Copper = CreateSprite3D( #PB_Any, Copper()\Copper )
Copper()\x = 0
Copper()\y = 300 + I * 25
Copper()\Color = Random( 65000 )
Next
ClearScreen( 0 )
StartDrawing( ScreenOutput() )
DrawingMode( #PB_2DDrawing_Default )
DrawingFont( FontID( Font1) )
DrawText( 10,300, "PURE BASIC", RGB( 250,150,150 ) )
StopDrawing()
Maske1 = GrabSprite( #PB_Any, 0, 0,1024,768, #PB_Sprite_Texture )
TransparentSpriteColor( Maske1, RGB( 250, 150, 150 ) )
StartDrawing( SpriteOutput( Maske1 ) )
FillArea( 0, 0, RGB( 250, 150, 150 ), 0 )
FillArea( 63, 370, RGB( 250, 150, 150 ), 0 )
FillArea( 285, 370, RGB( 250, 150, 150 ), 0 )
FillArea( 555, 370, RGB( 250, 150, 150 ), 0 )
FillArea( 555, 420, RGB( 250, 150, 150 ), 0 )
FillArea( 670, 400, RGB( 250, 150, 150 ), 0 )
StopDrawing()
ClearScreen( 0 )
StartDrawing( ScreenOutput() )
DrawingMode( #PB_2DDrawing_Default )
For i = 0 To 20
Circle( 60, 40, 40 - i , RGB( 255, i * 3, i * 3 ) )
Next
DrawingMode( #PB_2DDrawing_Transparent )
DrawText( 30,30, "That is it ! ", RGB( 255, 255, 255 ) )
StopDrawing()
Circle1 = GrabSprite( #PB_Any, 0, 0, 128, 128, #PB_Sprite_Texture )
Circle2 = CreateSprite3D( #PB_Any, Circle1 )
Procedure CreatePic()
Protected Count.l
Count = Random( 10 ) + 5
For i = 0 To Count
AddElement( Pic() )
Pic()\Num = PicSet( Random( 5 ) )
Pic()\x = Random( 1024 )
Pic()\y = Random( 200 ) + 100
Pic()\w = 45 + Random( 90 )
Pic()\Trans = 0
Pic()\z = Random( 32 ) + 16
Pic()\Fade = #False
Next
EndProcedure
Procedure ShowPic()
ForEach Pic()
Sprite3DQuality( 1 )
Sprite3DBlendingMode( 5, 7 )
ZoomSprite3D( Pic()\Num, Pic()\z, Pic()\z )
RotateSprite3D( Pic()\Num, 0.05, 1 )
DisplaySprite3D( Pic()\Num, Pic()\x, Pic()\y, Pic()\Trans )
Pic()\x + Cos( Radian( Pic()\w ) ) * 1.5
Pic()\y + Sin ( Radian( Pic()\w ) ) * 1.5
If Pic()\Fade = #True
Pic()\Trans - 2
If Pic()\Trans <= 0
DeleteElement( Pic() )
EndIf
Else
Pic()\Trans + 2
If Pic()\Trans >= 255
Pic()\Trans = 255
Pic()\Fade = #True
EndIf
EndIf
Next
EndProcedure
Procedure ShowCopper()
ForEach Copper()
DisplaySprite3D( Copper()\ Copper, Copper()\x, Copper()\y, 255 )
Next
If ElapsedMilliseconds() > Time
ForEach Copper()
Copper()\y +2
If Copper()\y >= 445
Copper()\y = 295
EndIf
Next
Time = ElapsedMilliseconds() + 30
EndIf
EndProcedure
SetFrameRate( 60 )
Repeat
ClearScreen( 0 )
If ElapsedMilliseconds() > Time2
CreatePic()
Time2 = ElapsedMilliseconds() + 1000
EndIf
Start3D()
ShowCopper()
RotateSprite3D( Circle2, 5, 1 )
DisplaySprite3D( Circle2, Circle2X, 330, 255 )
Circle2X + 5
If Circle2X > 1024: Circle2X = - 128: EndIf
Stop3D()
DisplayTransparentSprite( Maske1, 0, 0 )
If IsSprite3D( Sprite2 ): FreeSprite3D( Sprite2 ): EndIf
If IsSprite( Sprite1 ): FreeSprite( Sprite1 ): EndIf
Sprite1 = GrabSprite( #PB_Any, 0, 0, 1024, 768, #PB_Sprite_Texture )
Sprite2 = CreateSprite3D( #PB_Any, Sprite1 )
If IsSprite3D( Sprite2 )
Start3D()
ShowPic()
Sprite3DBlendingMode( 5, 7 )
RotateSprite3D( Sprite2, r, 0 )
DisplaySprite3D( Sprite2, 0, 0, 255 )
Stop3D()
r+3
If r = 360: r= 0:EndIf
EndIf
StartDrawing( ScreenOutput() )
DrawingMode( #PB_2DDrawing_Transparent )
DrawingFont( FontID( Font1 ) )
DrawText( TextX, 500, "COPPER DEMO", RGB( 0,255,0 ) )
DrawText( TextX, 100, "COPPER DEMO", RGB( 0,255,0 ) )
TextX + 4
If TextX > 1024: TextX = - 1024: EndIf
StopDrawing()
FlipBuffers()
Delay( 1 )
ExamineKeyboard()
Until KeyboardPushed( #PB_Key_Escape )
End
Wieso meinst du nicht so flexibel ?
Wenn ich es total flexibel haben möchte, dann würde ich eben soviel
Ebenen machen, wie ich brauche und gebe nur noch an auf welche Ebene
das, oder die Objekte gemalt werden sollen.