GDdraw2d_cursor

Synopsis

Define a module to draw a cross-hair cursor

GDdraw2d_cursor_notify_templ

group GDdraw2d_cursor_notify_templ
{
int+IPort2 state;
method+notify_val upd_func = "GDdraw2d_cursor";
};

GDdraw2d_cursor_templ

GDdraw2d_cursor_notify_templ GDdraw2d_cursor_templ
{
int+IPort2 x;
int+IPort2 y;
int immed;
GDview_templ+IPort2 &view_in;
GDcamera_templ+IPort2 &cam_in;
GDobject_templ+IPort2 &obj_in;
Mesh+OPort2 out_mesh;
};

GDdraw2d_cursor


GDdraw2d_cursor_templ GDdraw2d_cursor {
immed = 1;
};

Description

These templates define a module to draw a full screen cross-hair cursor. GDdraw2d_cursor_notify_templ defines the elements that cause the module's update method to execute. GDdraw2d_cursor_templ defines the additional elements that are used at execution time but do not trigger an activation. GDdraw2d_cursor provides initial values to some of the elements. This is the template that should be instanced.

GDdraw2d_cursor displays a 2D cross-hair cursor and translates the cursor's screen coordinates to a field.

Input

state

This input indicates that a draw cursor operation is in progress: 1 means that the operation is beginning; 2 means that the operation is in progress; and 3 means that the operation is completed. You typically connect this to a UItwoPoint's state subobject.

x
y

These inputs are the x and y screen space coordinates of the cursor. You typically connect these to the x and y parameters of the UItwoPoint connected to state.

view_in

A connection to a view.

cam_in

A connection to a camera, typically the view's picked camera.

obj_in

An optional connection to a Graphics Display Kit object. Without a connection to an object, GDdraw2d_cursor creates a field in the connected camera's coordinate system. With a connection to an object, GDdraw2d_cursor creates a field in the connected object's coordinate system.

Parameters

immed

This parameter when set to 1 indicates that immediate mode is on. In immediate mode, GDdraw2d_cursor translates the cursor's position to a field continually during the UItwoPoint interaction. When immed is set to 0, GDdraw2d_cursor translates the cursor's position to a field only at the end of the UItwoPoint interaction.

Output Port

out_mesh

The output field containing the point that the cross-hair was centered at in the appropriate coordinate system.

Example

Libraries.Graphics_Display.Interactivity.UI_Interactivity.DrawCursor2d

File

v/gd.v

See also related modules

DrawCursor2D .