sprite stuff

This commit is contained in:
Ruben Müller 2011-08-20 20:14:22 +02:00
parent b09169256b
commit 5ea7373d3e
6 changed files with 16 additions and 16 deletions

BIN
data/gfx/logo.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
data/gfx/logo.psd Normal file

Binary file not shown.

View file

@ -7,13 +7,15 @@
; the dispatcher. The events are controlled by the ; the dispatcher. The events are controlled by the
; HandleEventMenu() function. ; HandleEventMenu() function.
Procedure DrawMenu() Procedure DrawMenu()
DisplaySprite(GFXLogo, 160, 50)
StartDrawing(ScreenOutput()) StartDrawing(ScreenOutput())
Define Black = RGB(0, 0, 0) Define Black = RGB(0, 0, 0)
Define White = RGB(255, 255, 255) Define White = RGB(255, 255, 255)
Define ActiveMenuItemColor = RGB(255, 0, 0) Define ActiveMenuItemColor = RGB(255, 0, 0)
DrawingFont(Font_H1) ;DrawingFont(Font_H1)
DrawText(50, 50, *ActiveMenu\Title, white, black) ;DrawText(50, 50, *ActiveMenu\Title, white, black)
Define Offset = 0 Define Offset = 0
Define FontColor = White Define FontColor = White
@ -25,7 +27,7 @@ Procedure DrawMenu()
EndIf EndIf
DrawingFont(Font_H2) DrawingFont(Font_H2)
DrawText(50, 300+(Offset*30), *ActiveMenu\Entries()\Label, FontColor, Black) DrawText(200, 350+(Offset*30), *ActiveMenu\Entries()\Label, FontColor, Black)
Offset = Offset+1 Offset = Offset+1
Next Next
StopDrawing() StopDrawing()
@ -37,5 +39,5 @@ Procedure DrawRunningGame()
Box(0, 0, 200, 200, RGB(0, 255, 0)) Box(0, 0, 200, 200, RGB(0, 255, 0))
StopDrawing() StopDrawing()
DisplaySprite(Tile01, 20, 20) DisplaySprite(GFXTileset, 20, 20)
EndProcedure EndProcedure

View file

@ -3,9 +3,13 @@
; ***************************************************************************** ; *****************************************************************************
; * Tileset ; * Tileset
Procedure InitGraphics()
GFXLogo = LoadSprite(#PB_Any, "../data/gfx/logo.bmp")
GFXTileset = LoadSprite(#PB_Any, "../data/gfx/tileset01.bmp")
EndProcedure
Procedure InitTileset() Procedure InitTileset()
Tile01 = LoadSprite(#PB_Any, "../data/gfx/tileset01.bmp") ClipSprite(GFXTileset, 0, 0, 16, 16)
;ClipSprite(#Tile01, 0, 0, 16, 16)
EndProcedure EndProcedure

View file

@ -17,16 +17,8 @@ Global Font_H1 = LoadFont(1, "Courier", 40, #PB_Font_Bold)
Global Font_H2 = LoadFont(2, "Verdana", 18) Global Font_H2 = LoadFont(2, "Verdana", 18)
; Graphics ; Graphics
Global Tile01.i Global GFXLogo.i
Global GFXTileset.i
Enumeration 500
#Tile01
#Tile02
#Tile03
#Tile04
#Tile05
#Tile06
EndEnumeration
; Sounds ; Sounds
LoadSound(0, #DATA_PATH + "sound/menu_change.wav") LoadSound(0, #DATA_PATH + "sound/menu_change.wav")

View file

@ -74,6 +74,7 @@ menus("RLY_QUIT")\Entries() = Item
If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCentered) If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, Screen\Width, Screen\Height, 0, 0, 0) OpenWindowedScreen(WindowID(0), 0, 0, Screen\Width, Screen\Height, 0, 0, 0)
InitGraphics()
InitTileset() InitTileset()
Repeat Repeat
@ -93,6 +94,7 @@ If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCent
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0) OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
Fullscreen = 0 Fullscreen = 0
EndIf EndIf
InitGraphics()
EndIf EndIf
; Debug CurrentState ; Debug CurrentState