HomeIndex

Image Functions

createImage(sheet,image[,point])|createImage(image)|createImage()
Creates and optionally positions an image.
createTextImage(font,text,flags)
Creates a text image
imageReplaceText(image,text)
Replaces the text of a text image
imageTextClip(image,clip)
Sets the clipping (in characters) of a text image.
imageTextDropShadow(image,offset,color)
Sets the drop shadow offset and color of a text image.
imageTextOutline(image,color)
Sets the outline color of a text image.
deleteImage(image)
Deletes an image and return null
deleteImagesChildren(image)
Deletes the children of image, but not the image
imageScale(image,scale) | imageScale(image,point)
Scales an image by scale or with point.x and point.y
imageScaleFromTo(image,time,from,to)
Scales an image over time seconds
imageQuickPop(image,time,amount)
Does a quick pop of the image over time seconds by amount
imageQuickPop(image, 0.25, 1.10) // 10% bigger imageQuickPop(image, 0.25, 2.00) // Twice as big imageQuickPop(image, 0.25, 1.00) // No pop
imageWiggle(image,time,amount,loops)
Wiggles an image over time seconds loop times.
imageRotate(image,angle)
Rotates an image by angle degrees
imageFilter(image,filter)
Turns on or off nearest neighbor filtering
imageSize(image)
Returns the size of an image as a point
Includes the size of all the children to form a combined size
imageAlign(image,alignment)
Aligns an image by alignment
The alignment can be ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_TOP or ALIGN_BOTTOM.
imageAlign(image, ALIGN_RIGHT)
Alignment can be combined
imageAlign(image, ALIGN_TOP|ALIGN_CENTER)
Text images can only be aligned using ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT
imageHide(image,state)
Hides or shows an image based on state
imageTouchable(image,state)
The button of this image is set to touchable state
imagePushPopFrozen(state)
Pushes or pops the frozen state of all images.
imageAt(image,pos) | imageAt(image)
Positions or returns the position of an image
imageMoveFromTo(image,type,time,start,end)
Moves an image from start to end points
Type can be LINEAR, EASE_IN, EASE_OUT, EASE_INOUT, SLOW_EASE_IN, SLOW_EASE_OUT, SIN_INOUT, or COS_INOUT
imageColor(image,color)
Set an image and it's children to a color.
The color can not include an alpha channel. Use imageAlpha() for that.
imageAlpha(image,alpha)
Sets the alpha of an image and all it's children.
imageAlphaFromTo(image,time,from,to)
Changes alpha over time seconds.
imageSort(image,sort) | imageSort(image)
Sets or returns an image sorting order
This can only sort images at the top level. It's won't effect the sorting order of children images.
imageScissor(image,x,y,dx,dy)
Scissor (crop for display) an image based on screen coordinates.
imageParentChild(parent_image,child_image)"
Makes child_image a render child of parent_image
createButton(id,image,parent,code)
Creates a button based on an image parented to parent calling code when clicked/touched.
The id can be anything and is passed the code.
createButton({verb=verb_id, image=verb_image, object=object}, verb_image, ROOT(verb_popup_node), @(user, event) { if (event == BUTTON_EVENT_HOVER) { imageWiggle(user.image, 0.25, 2, 1) imageColor(user.image, COLOR_YELLOW) } else if (event == BUTTON_EVENT_NORMAL) { imageColor(user.image, COLOR_WHITE) } else if (event == BUTTON_EVENT_DOWN) { if (user.verb == "verb_lookat") { ROOT(verb_object) = null actorTurnTo(selectedActor, user.object) callVerb(user.object, user.verb) } else { ROOT(verb_call_object) = user.object ROOT(verb_call_verb) = user.verb actorWalkTo(selectedActor, user.object) } closeVerbs() } })
In this sample, the id is an entire table containing information about the buttons.
findButtonAt(screen_pos)
Finds a button created with createButton and returns the id or null if not found