Results 1 to 9 of 9

Thread: i need help With PXL

  1. #1
    Junior Member
    Join Date
    Apr 2018
    Location
    Madrid - Spain
    Posts
    5

    i need help With PXL

    Hello;

    I'm new with delphi and pxl and have some Questions.

    1- how i can change the pixel size automatically when i create an full screen app

    I think the code is myDevice.Windowed:= True; in Asphyre but not in PXL.

    2- what is the equivalent of this code in pxl ? >

    myCanvas.DrawRot(myImage, X, Y, Angle, Scale, Color, Trunc(Pattern), DrawFx);


    Thanks!

  2. #2
    Quote Originally Posted by paspas View Post
    1- how i can change the pixel size automatically when i create an full screen app

    I think the code is myDevice.Windowed:= True; in Asphyre but not in PXL.
    In form's create event, use this code:
    Code:
      BorderStyle := bsNone;
      Left := 0;
      Top := 0;
      ClientWidth := Screen.Width;
      ClientHeight := Screen.Height;
    This should make the application full-screen.

    Quote Originally Posted by paspas View Post
    2- what is the equivalent of this code in pxl ? >

    myCanvas.DrawRot(myImage, X, Y, Angle, Scale, Color, Trunc(Pattern), DrawFx);
    You can find equivalent in "Basic" example, which would look like this:
    Code:
      // Draw the image of famous Lenna.
      EngineCanvas.UseImage(EngineImages[ImageLenna]);
      EngineCanvas.TexQuad(TQuad.Rotated(
        Point2f(DisplaySize.X * 0.5, DisplaySize.Y * 0.5),
        Point2f(300.0, 300.0),
        EngineTicks * 0.01),
        IntColorAlpha(128));

  3. #3
    Junior Member
    Join Date
    Apr 2018
    Location
    Madrid - Spain
    Posts
    5
    Thanks for your reply.
    But the images size are not enlarged and fonts and other pixel size ?


  4. #4
    Yes, changing display resolution nowadays to a non-native one isn't exactly desirable, and on mobiles it isn't even possible.

    Therefore, for a project that was made for a fixed resolution, there are two ways to handle this:

    1. Rescale everything in code yourself (might require significant development effort).
    2. Render everything to a render target (check Tunnel example to see how you can use TBitmap for that) of fixed size, e.g. 640x480, then simply draw such render target to fit whole screen, which would take care of scaling and simulate older behavior.

  5. #5
    Junior Member
    Join Date
    Apr 2018
    Location
    Madrid - Spain
    Posts
    5
    Thank you very much for your reply.

  6. #6

  7. #7
    Junior Member
    Join Date
    Apr 2018
    Location
    Madrid - Spain
    Posts
    5
    Quote Originally Posted by devchenxip View Post
    Thanks for sharing.

    what about Particle Editor is it open source ??
    Is there similar source that works with PXL ??

  8. #8
    Quote Originally Posted by paspas View Post
    Thanks for sharing.

    what about Particle Editor is it open source ??
    Is there similar source that works with PXL ??

    I'm porting the particle editor from the phoenix engine to the PXL.

  9. #9
    PXL is cool, a while ago, I have "commited" component for this library : Perhaps code could help, I have not yet finished to porting it to FPC. If someone is interested.
    https://github.com/VincentGsell/PXLComponents

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
  •