vital motion
yo ! welcome

Join the forum, it's quick and easy

vital motion
yo ! welcome
vital motion
Would you like to react to this message? Create an account in a few clicks or log in to continue.

hi all good news !

Go down

hi all good news ! Empty hi all good news !

Post  yogi Wed 26 May - 0:58

hi all

good news i for the moment try to decode the code of a scrolling text

ok i'm a noob in code but the other code would be cool i think

no 3d sprite as previous but only 2d , coming from one month to another

128 colors for the background

hummm 4 colors for the main scrolling

f1 to f8 for pictures

and f12 for second scroll , from bottom to up

tommorow all day on animated skills, the evening for any cool code as the sprite and
the scrolling

going to install amikit on nux ubuntu and then have the sys to code
and by time test it on rl amiga 68020

see you soon then

steff
yogi
yogi
Admin

Messages : 322
Date d'inscription : 2009-10-09
Age : 48

http://vitalmotion.purforum.com

Back to top Go down

hi all good news ! Empty Re: hi all good news !

Post  yogi Wed 26 May - 19:09

hoh la the code for the main scroll

as purebasic 4.xx with direct x vbut i will change it for amiga classic aga

so

"*Code:*
;===========================================================================
;-CONSTANTS
;===========================================================================

#APP_NAME = ""

#SCREEN_WIDTH = 640
#SCREEN_HEIGHT = 480

#BITMAP_FONT_WIDTH = 16
#BITMAP_FONT_HEIGHT = 24

;===========================================================================
;-GLOBAL FLAGS / VARIABLES / STRUCTURES / ARRAYS
;===========================================================================

Global GammaSetting.f
Global ModuleToggle.b
Global DrawTextToggle.b
Global ImageYPos.f
ImageYPos = #SCREEN_HEIGHT
Global ScrollerPosX.f
ScrollerPosX = #SCREEN_WIDTH
Global ScrollerPosY.f
ScrollerPosY = (#SCREEN_HEIGHT - #BITMAP_FONT_HEIGHT) - 5
StartText.s = "All your base are belong to us..."


;===========================================================================
;-PROCEDURES
;===========================================================================

;simple error checking
Procedure HandleError(result, text.s)
If result = 0 : MessageRequester("Error", text,
#PB_MessageRequester_Ok) : End : EndIf
EndProcedure

;scroll continuously
Procedure ContinuousScroll(ScrollText.s)
ScrollText = UCase(ScrollText)
ScrollerPosX - 3.0
ScrollLimit.f = Len(ScrollText) * 16.00
ScrollLimit = ScrollLimit - (ScrollLimit * 2)
If ScrollerPosX < ScrollLimit
ScrollerPosX = #SCREEN_WIDTH
EndIf
TextPosX = ScrollerPosX
For x = 1 To Len(ScrollText)
Character = Asc(Mid(ScrollText, x, 1))
If Character > 64 And Character < 91
Character - 65
ClipSprite(1, Character * #BITMAP_FONT_WIDTH, 0,
#BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 32
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 45
ClipSprite(1, 667, 0, #BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 46
ClipSprite(1, 576, 0, #BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character > 47 And Character < 58
Character - 22
ClipSprite(1, Character * #BITMAP_FONT_WIDTH, 0,
#BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
EndIf
Next x
EndProcedure

;scroll once
Procedure OneShotScroll(ScrollText.s)
ScrollText = UCase(ScrollText)
ScrollerPosX - 3.0
ScrollLimit.f = Len(ScrollText) * 16.00
ScrollLimit = (#SCREEN_WIDTH / 2) - (ScrollLimit / 2)
If ScrollerPosX < ScrollLimit
ScrollerPosX = ScrollLimit
EndIf
TextPosX = ScrollerPosX
For x = 1 To Len(ScrollText)
Character = Asc(Mid(ScrollText, x, 1))
If Character > 64 And Character < 91
Character - 65
ClipSprite(1, Character * #BITMAP_FONT_WIDTH, 0,
#BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 32
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 45
ClipSprite(1, 667, 0, #BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character = 46
ClipSprite(1, 576, 0, #BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
ElseIf Character > 47 And Character < 58
Character - 22
ClipSprite(1, Character * #BITMAP_FONT_WIDTH, 0,
#BITMAP_FONT_WIDTH, #BITMAP_FONT_HEIGHT)
DisplayTransparentSprite(1, TextPosX, ScrollerPosY)
TextPosX + #BITMAP_FONT_WIDTH
EndIf
Next x
EndProcedure

;===========================================================================
;-GEOMETRY / SCREEN / INIT
;===========================================================================

HandleError(InitSprite(), "Error Initialising
DirectX:"+Chr(10)+"Microsoft DirectX v7.0+ must be installed
correctly."+Chr(10)+"Offending Command: InitSprite()")
HandleError(InitKeyboard(), "Error Initialising
DirectX:"+Chr(10)+"Microsoft DirectX v7.0+ must be installed
correctly."+Chr(10)+"Offending Command: InitKeyboard()")
HandleError(InitMouse(), "Error Initialising
DirectX:"+Chr(10)+"Microsoft DirectX v7.0+ must be installed
correctly."+Chr(10)+"Offending Command: InitMouse()")
HandleError(InitSound(), "Error Initialising
DirectX:"+Chr(10)+"Microsoft DirectX v7.0+ must be installed
correctly."+Chr(10)+"Offending Command: InitSound()")
HandleError(InitSprite3D(), "Error Initialising
DirectX:"+Chr(10)+"Microsoft DirectX v7.0+ must be installed
correctly."+Chr(10)+"Offending Command: InitSound()")

HandleError(OpenScreen(#SCREEN_WIDTH, #SCREEN_HEIGHT, 32, #APP_NAME),
"640x480 32bit Screen could not be opened correctly.")

;===========================================================================
;-MEDIA
;===========================================================================

UsePNGImageDecoder()
HandleError(CatchSprite(1, ?Font), "Couldn't load 'font1.png'")

;===========================================================================
;-MAIN LOOP
;===========================================================================

BaseTime.l = GetTickCount_()

Repeat
CurrentTime = GetTickCount_()

FlipBuffers()
ClearScreen(0)

StartDrawing(ScreenOutput())

;SCROLLER BACKGROUND BOX
If CurrentTime >= BaseTime + 5000
If BoxWidth < #SCREEN_WIDTH
BoxWidth + 6
EndIf
Box(0, (#SCREEN_HEIGHT - #BITMAP_FONT_HEIGHT) - 10, BoxWidth,
#BITMAP_FONT_HEIGHT + 10, RGB(36, 46, 64))
LineXY(0, (#SCREEN_HEIGHT - #BITMAP_FONT_HEIGHT) - 10, BoxWidth,
(#SCREEN_HEIGHT - #BITMAP_FONT_HEIGHT) - 10, RGB(46, 56, 84))
EndIf

StopDrawing()

;FIRST SCROLLER
If CurrentTime >= BaseTime + 7000 And CurrentTime <= BaseTime + 34500
ContinuousScroll("-- Continuously Scrolling Text -- ")
EndIf

;RESET SCROLLER
If CurrentTime >= BaseTime + 34500 And CurrentTime <= BaseTime + 35000
ScrollerPosX = #SCREEN_WIDTH
EndIf

;SECOND SCROLLER
If CurrentTime >= BaseTime + 35000 And CurrentTime <= BaseTime + 50000
OneShotScroll("-- One Shot Deal --")
EndIf

;RESET SCROLLER
If CurrentTime >= BaseTime + 50000 And CurrentTime <= BaseTime + 50500
ScrollerPosX = #SCREEN_WIDTH
EndIf

;CHECK FOR ESCAPE
ExamineKeyboard()
If KeyboardReleased(#PB_Key_Escape)
Quit = 1
End
EndIf

Delay(1)
HandleError(IsScreenActive(), "'Alt-Tabbing' is not supported.")

ForEver
End

;===========================================================================
;-BINARY INCLUDES
;===========================================================================

DataSection
Font:
IncludeBinary "font1.png"
EndDataSection


Font:
Image"


pleaz hivernaal and all have a look at

my choice for main scroll

regards
yogi
yogi
Admin

Messages : 322
Date d'inscription : 2009-10-09
Age : 48

http://vitalmotion.purforum.com

Back to top Go down

hi all good news ! Empty Re: hi all good news !

Post  yogi Wed 26 May - 19:10

and change png decoder to iff decoder of course

hop yo go on ready buddy !

steff
yogi
yogi
Admin

Messages : 322
Date d'inscription : 2009-10-09
Age : 48

http://vitalmotion.purforum.com

Back to top Go down

hi all good news ! Empty Re: hi all good news !

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum