BrightSign BrightScript 3.0 Reference Manual User Manual

Page 67

Advertising
background image

62

if

h>MAXHI

then

h=MAXHI

xpix =

cint

((vidmode.GetResX() - w*CELLWID)/2)

' center game board on screen

ypix =

cint

((vidmode.GetResY() - h*CELLHI)/2)

' center game board on screen

REM

REM Create Text Field with square char cell size

REM

meta=CreateObject(

"roAssociativeArray"

)

meta.AddReplace(

"CharWidth"

,CELLWID)

meta.AddReplace(

"CharHeight"

,CELLHI)

meta.AddReplace(

"BackgroundColor"

,&H202020)

'very dark grey

meta.AddReplace(

"TextColor"

,&H00FF00)

' Green

m.text_field=CreateObject(

"roTextField"

,xpix,ypix,w,h,meta)

if

type(m.text_field)<>

"roTextField"

then

print

"unable to create roTextField 1"

stop

endif

End

Function

REM

REM As Object refers to type BrightScript Component

REM m the "this" pointer

REM

Sub

gbSetSnake(snake

As

Object

)

m.snake=snake

End

Sub

Advertising