Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 26th, 2003, 05:03 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 558 marron79 User rank is Private First Class (20 - 50 Reputation Level)marron79 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 9 h 41 sec
Reputation Power: 7
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!
__________________
Matt

Last edited by marron79 : February 26th, 2003 at 05:08 PM.

Reply With Quote
  #2  
Old February 27th, 2003, 09:21 AM
calorics calorics is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 12 calorics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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

Reply With Quote
  #3  
Old February 27th, 2003, 02:39 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 558 marron79 User rank is Private First Class (20 - 50 Reputation Level)marron79 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 9 h 41 sec
Reputation Power: 7
Re: pygame

Quote:
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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Can I "draw" text or images?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway