I was wanting to have a rectangle that moves with the mouse and has a min/max y pos.. I am having trouble fig that out.. any ideas.. It can be for any graphics library for free pascal.. I am just looking for examples.

interface

uses
Classes, SysUtils,

phxBase,
phxScreen,
phxCanvas,
phxTypes;

procedure MainLoop;

implementation

var Polygon: Array[0..2] of TVector2i = (
(X: 200; Y: 200),
(X: 300; Y: 200),
(X: 300; Y: 300)
);

//------------------------------------------------------------------------------
procedure MainLoop;
var Screen: TPHXScreen;
var Canvas: TPHXCanvas;
begin
// Get the window
Screen:= TPHXScreen.getInstance();

// Open the window
Screen.Open('Phoenix Canvas Demo', -1, -1, 800, 600);


Canvas:= TPHXCanvas.Canvas;
repeat
// Clear the window
Screen.Clear();

Canvas.Pen.Color:= clrPurple;




Canvas.Rectangle(10,10, 50,50);




// Flip the buffers
Screen.Flip();

until (Screen.Visible = False) ;

end;

end.