SetPaintImage

From Planimate Knowledge Base
Jump to navigation Jump to search

You can use this to Create a Paint Object that will change the image displayed, via routine command.

Create an image using the paint function. Whilst in Paint Mode - right click on the screen and select Image. From the window broser chose the bitmap image file to use (eg redlight.bmp) Then add the image to the Paint Label List by right clicking on the image and selecting Add to Paint

Label List. Type in an appropriate name (eg Traffic Light).

Create a Portal Attirbute called Traffic Mode. Create a Label List called Traffic Colours. Add two labels: redlight.bmp and greenlight.bmp Setup an Entry, Change Object - Routine x 2, and Exit.

Open the first Routine and add a routine operation: IF with the condition p.Traffic Mode = 0 Insert before the END IF the routine operation Set p.Traffic Mode = 1 Insert before the END IF the routine operation ELSE Insert before the END IF the routine operation Set p.Traffic Mode = 0 (This will change the traffic mode from 1 to 0, OR from 0 to 1).

Open the second Routine and add a routine operation: IF with the condition p.Traffic Mode = 0 Insert before the END IF the routine operation - Set PaintImage ( Traffic Light (Paint Object Label) to image redlight.bmp (label list - Traffic colours) Insert before the END IF the routine operation - ELSE Insert before the END IF the routine operation - Set PaintImage ( Traffic Light (Paint Object Label) to image greenlight.bmp (label list - Traffic colours) (This will set the image to redlight.bmp if the traffic mode is 0, OR to greenlight if the traffic mode is 1) Add a ForceRepaint operation.


Change the Entry mode to Upon click (and continue). Use the Flows to add a new path between Entry, Routine 1, Routine 2, and the Exit.

Wiki paintimage flow.jpg

NOTE: If you want to make this more complex, you could have the the selection of image to be used via a table lookup. Could search the rows for a match in the details of what image to be shown (eg column 1 is Traffic mode) and thus the cell in the row of which image to use (eg column 2 is Traffic Colours label list).