###############################################################################
#
# entername.txt
# original name entering scene for XR7: EarthStrike developed by Drake Analytics, Inc.
# www.xandis.com
#
# This is the data for the enter-name sequence of the game. This happens
# if a player achieves a Top-10 score. The scene is rather simple with just
# a background image, a text edit line, mouse cursor and OK button. Music
# in the background is also on.
#
#	The GUI spec is defined in enternames-gui.txt and the high scores data
#	is stored in ../highscores-spec.txt
#
###############################################################################
def lighting MainAmbientLight
	color = 255 255 255 255
end

def bounds MainBounds
	min = -10.0 -10.0 -10.0
	max = 10.0 10.0 100.0
end

def projection NormalProjection
	nearplane	= 1.0
	farplane	= 100.0
	fov		= 0.7850
	aspect		= 1.0
end

def camera NormalCamera
	lookat	= 0.0 0.0 0.0
	pos	= 0.0 0.0 -10.0
	up	= 0.0 1.0 0.0
end

################## RENDER STATES ######################
#
def renderstate SpriteRenderState
	id		= 3
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= SRCALPHA
	alphadest	= INVSRCALPHA
	blendop		= ADD
	cull		= NONE
	clipping	= y
end

def renderstate XSpriteRenderState
	id		= 2
	zenable		= f
	specularenable	= f
	fogenable	= f
	alphaenable	= t
	lightenable	= f
	fillmode	= SOLID
	shading		= GOURAUD
	lighting	= 255 255 255
	alphasrc	= SRCALPHA
	alphadest	= DESTALPHA
	blendop		= ADD
	cull		= NONE
	clipping	= y
end

###################### SPRITES #####################
#
def sprite GUIMouse
	source		= sprites\menu-mouse.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOkBtn1
	source		= sprites\setup-okbtn-1.dds
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOkBtn2
	source		= sprites\setup-okbtn-2.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOkBtn3
	source		= sprites\setup-okbtn-3.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite GUIOkBtn4
	source		= sprites\setup-okbtn-4.dds
	transformed 	= y
	maxonscreen 	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage1
	source		= sprites\get-highscore-1.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage2
	source		= sprites\get-highscore-2.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage3
	source		= sprites\get-highscore-3.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite BackImage4
	source		= sprites\get-highscore-4.bmp
	transformed	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate	= SpriteRenderState
end

def sprite EditLineCursor
	source		= sprites\editline-cursor.bmp
	transformed 	= y
	maxonscreen	= 1
	size		= 1.0
	renderstate 	= XSpriteRenderState
end

###################### BACK IMAGE #####################
#
def backimage BackImage
	numimages	= 4
	image1		= BackImage1
	image2		= BackImage2
	image3		= BackImage3
	image4		= BackImage4
	pos1		= 144.0	42.0	0.0
	pos2		= 400.0	42.0	0.0
	pos3		= 144.0	298.0	0.0
	pos4		= 400.0	298.0	0.0
end

###################### GUI #####################
#
# GUI = Graphical User Interface
#
# A GUI may consist of buttons, sliders and an
# edit line. That's it; nothing complicated but
# just enough for 80s style arcade games. The
# real definition occurs in the source file.
#
def gui EnterNameGUI
	source = levels\entername-gui.txt
end

################# MUSIC AND WAVES #################
#
def music EnterNameMusic
	source	= audio\music\pomp.mid
	repeats = 1000
end

###################### FONT ######################
#
def font EnterNameFont
	usebitmap		= y
	renderstate		= SpriteRenderState
#
# if using bitmap (i.e. extracting chars from a file - old style but faster):
#
	bitmap			= sprites\highscores-font.dds
	size			= 16	# NxN in pixels where N = 8 or 16
	vspacing		= 2
	hspacing		= 2
	maxstringsize	= 32
#
# if creating chars on-the-fly from windows fonts (slow but flexible and not really tested!):
#
#	typeface		= Arial
#	color			= 255 255 255 	# R G B 
#	size			= 24
#	bold			= 4		# (-4 to 8 with 0 as normal)
#	italic			= f
#	underline		= f
#	strikeout		= f
end

########################### SCENE ############################
#
def scene main
	playmusic	= EnterNameMusic
	setcamera	= NormalCamera
	setprojection	= NormalProjection
	setambientlight	= MainAmbientLight
	setbackcolor	= 0 0 0			# R G B
	setrenderstate	= SpriteRenderState 	# start off with any old render state
	setbounds	= MainBounds
	setbackimage	= BackImage
	setgui		= EnterNameGUI

	waitframes	= 1000000		# wait a few hours
	eos				
end

### END OF SCENE

