Results 1 to 10 of 10

Thread: DXInput1.mouse.y what does this function returns?????

  1. #1

    DXInput1.mouse.y what does this function returns?????

    Hello,
    well here is another question from me:
    what does DXInput1.mouse.y return??
    cus` surely it is not the y coordinates of the mouse on the form.

    And if there is any other function that returns the current position of the mouse pls tell me.

    thanks in advance.

  2. #2

    DXInput1.mouse.y what does this function returns?????

    I haven't used DelphiX in a long time but DirectInput ususally doesn't work with screen coordinates but instead it will give you information about the mouse movement. So that Y-coordinate could be a negative value if the mouse is moved to the left.

    You can try putting this in your timer event:
    MyCursorPosY := MyCursorPosY + DXInput1.Mouse.Y;
    MyCursorPosX := MyCursorPosX + DXInput1.Mouse.X;
    DXInput1.Mouse.Y := 0; (Provided that this is not a read-only property)
    DXInput1.Mouse.X := 0; (Provided that this is not a read-only property)
    Ask me about the xcess game development kit

  3. #3

    DXInput1.mouse.y what does this function returns?????

    thanks will try it

  4. #4

    DXInput1.mouse.y what does this function returns?????

    well this doesnt work in my case
    isnt there any other way to get the possition of the mouse cursor?

  5. #5

    DXInput1.mouse.y what does this function returns?????

    Sure, just use the onMouseMove Event of TDxdraw.

    Here's some sample code

    [pascal]var mouseX, mouseY : word;
    (...)
    procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
    begin
    dxdraw1.Surface.fill(0);
    Dxdraw1.Surface.Canvas.TextOut(10,10,'('+inttostr( mouseX)+','+inttostr(mouseY)+')');
    dxdraw1.Surface.Canvas.Release;

    dxdraw1.flip;
    end;

    procedure TForm1.DXDraw1MouseMove(Sender: TObject; Shift: TShiftState; X,
    Y: Integer);
    begin
    mouseX := x;
    mouseY := y;
    end;
    [/pascal]

  6. #6

    DXInput1.mouse.y what does this function returns?????

    allready solved the problem with getcursorpos thanks anyway

    One more question how do i draw a rectangle or circle or smth else
    becouse with .draw() i doesn't get any results

  7. #7

    DXInput1.mouse.y what does this function returns?????

    You can use the DXDraw.Surface.Canvas to draw ractangles, circles etc. using the GDI functions. Just make sure you call Release when you are done:
    [pascal]with DXDraw.Surface.Canvas do try
    Ellipse(10, 10, 50, 50);
    // etc.
    finally
    Release;
    end;[/pascal]
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  8. #8

    DXInput1.mouse.y what does this function returns?????

    thanks that worked but how can i change the color or make it transparent?

  9. #9

    DXInput1.mouse.y what does this function returns?????

    http://wildebeest.dynup.net/tim/data.../34-i_want.bmp

    i want to make something like this, the black color is the transparent one. is it possible?[/pascal]

  10. #10

    DXInput1.mouse.y what does this function returns?????

    Look at the TCanvas documentation in the Delphi help files. You can use Pen.Colour and Brush.Color to set the colour, to make things transparent I think you use Brush.Style := bsClear;
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •