This wiki is out of date, use the continuation of this wiki instead

Get point

From FenixWiki

Jump to: navigation, search


[edit] Definition

INT get_point ( <INT fileID> , <INT graphID> , <INT controlpointID> , <INT POINTER x>, <INT POINTER y>)

Allows you to obtain a control point of a particular graph.

Any graph can contain an undetermined number of control points where control point 0 is the center of the graphic. This function allows you to know the location of any control point belonging to any graph.

To set a control point, use set_point() or, for only the center of a graph, set_center().

[edit] Parameters

INT fileID - Number of the FPG library.
INT graphID - Number of the graph inside the library which you want to use.
INT controlpointID - Number of the control point.
INT POINTER x - Pointer to where the X-coordinate of the control point will be written.
INT POINTER y - Pointer to where the Y-coordinate of the control point will be written.

[edit] Returns

INT : Successrate

false - One of the following: specified graph is invalid, specified control point is invalid, specified control point is undefined.
true - The control point was defined or the center was used.

[edit] Example

Program cpoint;
    int map;
    int cx,cy;

    // Create a red graph
    map = new_map(100,100,8);

    // Set the center to a random point

    // Get the center

    // Show the center
    say("Center-X: " + cx);
    say("Center-Y: " + cy);

    // Assign the map to the graph variable
    graph = map;

    // Set the location of this process to the center of the screen
    x = 160;
    y = 100;



Used in example: new_map(), map_clear(), set_center(), say(), pointer, graph

Notice that setting the center influences the position of the graph:

Controlpoints Functions
Get_point() • Set_center() •
Personal tools