RicScript
RicScript is a text base method for defining RIC files and was developed by John. C. Hansen.
With RicScript you can create the same kind of RIC files like you can do it with nxtRICeditV2 - but the big difference is that you have to use a text based editor for defining the RicScript files. The syntax of RicScript isn't very complex and will be described as following:
Element | Definition | |||||||||
Description |
desc( options, width, height );
In the current version of the firmware the paramter options will not be used and should be 0. The other two parameters will only be used by NXT-G - so the Description element has no effect for drawing pictures on the LCD
Example:
|
|||||||||
Sprite |
sprite( id, bitfields ); sprite( id, hexfields ); sprite( id, import( filename ) ); sprite( id, import( filename, brightness-threshold ) ); sprite( id, import( filename, brightness-threshold, destination_width, destination_height ) );
Define a Sprite element. You can define it with direct information about the pattern or you can import an existing gaphic file.
Example 1:
Example 2:
Example 3:
|
|||||||||
VarMap |
varmap( id, interpolation-point-definitions );
Define a interpolation function which can be used to transfer given parameter values to a destination value. Domain value of an interpolation point is between 0 and 255. The range value must be between 0 and 65535. Minimum count of interpolation points is 2 - maximum count of interpolation point is 256.
Example:
|
|||||||||
CopyBits |
copybits( copyopt, spriteid, source_x, source_y, width, height, dest_x, dest_y );
CopyBits will be used for transfering a rectangle area from the addresed sprite to the screen. Parameter copyopt is currently not used and should be 0.
Example:
|
|||||||||
Pixel |
pixel( copyopt, pos_x, pos_y ); pixel( copyopt, pos_x, pos_y, value );
The Pixel element can be used for drawing a single point on the NXT display. Parameter value is optional and will not be used in the current firmware version. Parameter copyopt is also not supported by the current firmware and should be set to 0.
Example:
|
|||||||||
Line |
line( copyopt, start_x, start_y, end_x, end_y );
Draw a line from the start point (start_x/start_y) to the end point (end_x/end_y). Parameter copyopt isn't supported by the current firmware and should be set to 0.
Example:
|
|||||||||
Rectangle |
rect( copyopt, edge1_x, edge1_y, edge2_x, edge2_y );
Draw a rectangle which is defined by the 2 oposite points (edge1_x/edge1_y) and (edge2_x/edge2_y). Parameter copyopt isn't supported by the current firmware and should be set to 0.
Example:
|
|||||||||
Circle |
circle( copyopt, center_x, center_y, radius );
Draw a circle with center point (center_x/center_y) and the given radius. Parameter copyopt isn't supported by the current firmware and should be set to 0.
Example:
|
|||||||||
NumBox |
numbox( copyopt, pos_x, pos_y, value );
Display the given value as a number on the NXT screen on the given position (pos_x/pos_y). Please keep in mind that the vertical position pos_y will be snaped to one of the 8 possible text lines. Parameter copyopt isn't supported by the current firmware and should be set to 0.
Example:
|
Example for a RicScript file which shows following output:
Output on the NXT screen |
|
|
RicScript: |
desc( 0, 51, 51 ); |