#1
  1. Rut row Raggy!
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2001
    Location
    Tornado Alley
    Posts
    560
    Rep Power
    31

    Question Can I "draw" text or images?


    In Win32, mIRC, and probably other lanugages, you can draw text or images on a certain part of the screen. For example, in Win32, you might create a function like this:

    void SayHello(HWND hWindow) {
    HDC hDC;
    RECT rect;

    GetClientRect(hWindow, &rect);
    hDC = GetDC(hWindow);
    DrawText(hDC, TEXT("Hello!"), -1, &rect,
    DT_SINGLELINE | DT_CENTER | DT_VCENTER);
    ReleaseDC(hWindow, hDC);
    }

    ...which writes "Hello" on the screen, and centers it.

    I was told that Python allows you to do this, but I have been unable to find any documentation of it. The reason I ask is because I want to be able to place text in a window at a certain point and have it (for example) print from right to left. Same thing with images...I want to be able to place them at a certain point on the screen. BTW, I'm using wxPython for as my IDE.

    Thanks in advance to anyone who can help!
    Last edited by marron79; February 26th, 2003 at 05:08 PM.
    Matt
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    12
    Rep Power
    0

    pygame


    I dont know how you can do that with pyWX but i know its very easy to do in pygame , take a look.

    Tytan
  4. #3
  5. Rut row Raggy!
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2001
    Location
    Tornado Alley
    Posts
    560
    Rep Power
    31

    Re: pygame


    Originally posted by calorics
    I dont know how you can do that with pyWX but i know its very easy to do in pygame , take a look.

    Tytan
    You know, I was actually at that site the other day. I thought it was a Python game, not a game API. Duh!

    Looks like they've got some good documentation there. I'm having a hard time finding the same documenation on wxpython.org (ie. that explains each function). Thanks for the tip!
    Matt

IMN logo majestic logo threadwatch logo seochat tools logo