Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How to get and position a text writed by player on the screen where is an image ?

Author
Message
Martin Donat
13
Years of Service
User Offline
Joined: 27th May 2011
Location: Czech Republic
Posted: 5th Aug 2011 15:51
I want to make in my game a code system, when you finish a level you get a code for next level a nd if you exit game, you can insert this code on the insert code screen, but I don´t know how to get this text from the keyboard and how to position this text on the screen, when the player is typing it ? And next problem what I have is, how to print a text on the screen when is there pasted an image with white background ?

the leader of Mouseking studio

Quisco DaLuse
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 5th Aug 2011 18:28
You can use the entry$(1) command or the input() command to accept keyboard input from the user.

To print text on the screen with a white background, use INK RGB. Example: INK RGB(255,0,0),RGB(255,255,255)
This sets the text to red with a white background.
Martin Donat
13
Years of Service
User Offline
Joined: 27th May 2011
Location: Czech Republic
Posted: 5th Aug 2011 19:37
Thanks, my issue with that text was I pu t the image in the Do-Loop after the text and the Image was on the text. When I put an image before the text the text was on the image.

the leader of Mouseking studio

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 7th Aug 2011 05:32 Edited at: 7th Aug 2011 05:41
i think you're looking for some type of get cursor functionality (vs set cursor) of which dbpro has none that i am aware of.

if you're using text then placing an image inline and in front of text wouldn't be too difficult with a little experimentation:


but placing an image after the text would be difficult as the determining where the text ends isn't easily available.

if you went to an image-based text system (ie, bitmap fonts), then i can see it working well (and not too terribly difficult) by, generally, adding the widths of each letter's image to an x "start" position and paste the final image behind them.

<shrugs> hope that helps

add: ok, i re-re-read your last post and i think you've worked out your issue making my post generally worthless as a response oh, well.

Virtual Nomad @ California, USA . DBPro V7.5
AMD Phenom™ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Martin Donat
13
Years of Service
User Offline
Joined: 27th May 2011
Location: Czech Republic
Posted: 27th Aug 2011 08:56
@ Virtual Nomad
Your response isn´t worthless, you help me with another problem, thanks !

the leader of Mouseking studio

Login to post a reply

Server time is: 2024-11-24 01:19:44
Your offset time is: 2024-11-24 01:19:44