0% found this document useful (0 votes)
37 views2 pages

Menu Button

The document describes a script for a menu button object in the RSDK Project for Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It includes event handlers for object interaction, drawing, and startup processes, managing touch input and sprite rendering based on device type. The script also loads necessary sprite sheets for visual elements in the menu interface.

Uploaded by

josepharturo2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Menu Button

The document describes a script for a menu button object in the RSDK Project for Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It includes event handlers for object interaction, drawing, and startup processes, managing touch input and sprite rendering based on device type. The script also loads necessary sprite sheets for visual elements in the menu interface.

Uploaded by

josepharturo2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// ----------------------------------

// RSDK Project: Sonic 1/Sonic 2


// Script Description: Menu Button Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 6 : TYPE_MENUBUTTON

// Static Values

// Tables

event ObjectMain
temp0 = screen.xsize
temp0 -= 62
temp1 = temp0
temp1 += 48
CheckTouchRect(0, 0, screen.xsize, screen.ysize)
if checkResult > -1
CheckTouchRect(temp0, 164, temp1, 214)
if checkResult > -1
object.value1 = 1
else
object.value1 = 0
end if
else
if object.value1 == 1
object.value1 = 0
if object[+1].value3 < 26
inputPress.start = 1
else
inputPress.buttonC = 1
end if
end if
end if
end event

event ObjectDraw
temp0 = screen.xsize
temp0 -= 38
if object[+1].value3 < 27
if object.value1 == 1
DrawSpriteScreenXY(1, temp0, 194)
else
DrawSpriteScreenXY(0, temp0, 194)
end if
else
if object.value1 == 1
DrawSpriteScreenXY(3, temp0, 194)
else
DrawSpriteScreenXY(2, temp0, 194)
end if
end if
end event
event ObjectStartup
LoadSpriteSheet("LevelSelect/Icons.gif")
foreach (TypeName[Menu Button], arrayPos0, ALL_ENTITIES)
switch engine.deviceType
case 0
object[arrayPos0].type = TypeName[Blank Object]
break
case 1
object[arrayPos0].priority = PRIORITY_ACTIVE
break
end switch
next
SpriteFrame(-20, -10, 40, 20, 97, 1)
SpriteFrame(-20, -10, 40, 20, 97, 43)
SpriteFrame(-20, -10, 40, 20, 97, 22)
SpriteFrame(-20, -10, 40, 20, 97, 64)
end event

event RSDKDraw
DrawSprite(0)
end event

event RSDKLoad
LoadSpriteSheet("Global/Display.gif")
SpriteFrame(-16, -16, 32, 32, 1, 143)
end event

You might also like