Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (Ayumi, Akow, monk12, AndrewAMD), 1,398 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
write text to bitmap #126252
04/25/07 09:25
04/25/07 09:25
Joined: Jan 2007
Posts: 7
F
freddylowski Offline OP
Newbie
freddylowski  Offline OP
Newbie
F

Joined: Jan 2007
Posts: 7
I would like to print text onto an entity. I thougth this might be possible in printing to the texture assigned to the entity.
Is there any possibility to write text to an bitmap with c script?

Re: write text to bitmap [Re: freddylowski] #126253
04/25/07 14:08
04/25/07 14:08
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Yes.

Get the bitmap pointer to the skin and use it with the pixel_ instructions. If you want to print text from a bitmap font on this skin, you have to extract each letter from the the font (loaded as bitmap, not as font) and "copy" it onto the target bmap.

Re: write text to bitmap [Re: HeelX] #126254
04/25/07 21:50
04/25/07 21:50
Joined: Jan 2007
Posts: 7
F
freddylowski Offline OP
Newbie
freddylowski  Offline OP
Newbie
F

Joined: Jan 2007
Posts: 7
Thanks.

Do I really have to read every single pixel from the fonts bitmap and copy it to the texture bitmap?

Re: write text to bitmap [Re: freddylowski] #126255
04/25/07 23:48
04/25/07 23:48
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
unfortunatly...


xXxGuitar511
- Programmer
Re: write text to bitmap [Re: xXxGuitar511] #126256
04/26/07 10:47
04/26/07 10:47
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
I'm not surprised that the bmap_blit function is not 'tree-listed' in my copy of the latest manual.
Given the missing source position / dimension specification argument, which is likely due to the idiotic 4 param function limitation, the function is relatively useless anyway.
Added note to add font bmap blit functions to tD0.dll (freeware; release pending).

Re: write text to bitmap [Re: testDummy] #126257
04/26/07 17:45
04/26/07 17:45
Joined: Apr 2006
Posts: 160
DerLateinProfi Offline
Member
DerLateinProfi  Offline
Member

Joined: Apr 2006
Posts: 160
Here's a tutorial from one of the AUM's!

Code:
Textinput Panel
Q: How can I show the coursor on a Panel and let the user make a input?
A: You need a text and a panel like shown beneath.



bmap input_pcx = <input.pcx>;
string temp_str = " "; // 20 characters
function input_text();
panel input_pan
{
bmap = input_pcx;
pos_x = 0;
pos_y = 0;
layer = 10;
on_click = input_text;
flags = refresh, d3d, visible;
}
text my_txt
{
layer = 20;
pos_x = 30;
pos_y = 35;
font = standard_font;
string = temp_str;
}
text dummy_txt // displays the text that was input
{
layer = 20;
pos_x = 15;
pos_y = 450;
font = standard_font;
flags = visible;
}
function input_text()
{
if ((mouse_pos.x > 7) && (mouse_pos.x < 215) && (mouse_pos.y > 20) && (mouse_pos.y < 45))
{
my_txt.visible = on;
str_cpy (temp_str, "");
inkey temp_str;
my_txt.visible = off;
// got the text in temp_str here
dummy_txt.string = temp_str; // show the input text
// .................
}
}





It woks fine! I know it i have used it! So use it too!


If there's a god He's watching can he give a ray of hope so much pain and so much sorrow www.lpp1991.de.vu

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1