Results 1 to 3 of 3

Thread: Text on center of the canvas (Left(X), not Top(Y)).

  1. #1

    Text on center of the canvas (Left(X), not Top(Y)).

    Anyone know how I might go about centering the left position of text on the surface screen when drawing? (This is just for introduction text for testing atm).

    The window is fixed to 350x350, I can easily find the middle, but i'd need to do something fancy to fit the text's length into that?

  2. #2

    Text on center of the canvas (Left(X), not Top(Y)).

    Something like:
    Code:
    ((canvas_width - text_length) div 2)
    Maybe I haven't understood your question
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #3

    Text on center of the canvas (Left(X), not Top(Y)).

    That might work yeah, just been awhile since iv'e done any of this.

    Also, now that iv'e finally gotten UnDelphiX 1.07B to install, for some reason I can't draw anything on DXDraw's surface, aside from text so far.

    e.g:

    [pascal]DXImageList.Items[0].Draw(DXDraw.Surface, 0, 0, 0);
    DXImageList.Items[1].Draw(DXDraw.Surface, 20, 20, 0);[/pascal]

    Does absolutely nothing, no matter where I put it. Either inbetween BeginScene; and EndScene or otherwise. (I of course Flip; at the end).

    EDIT: I see so UnDelphiX doesn't like JPEGS lol, especially concerning transparency, oh well I converted the cursor to a bitmap so it seems ok now.

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
  •