Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
User typing in a picture file, and game using it. #216199
07/15/08 17:38
07/15/08 17:38
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline OP
User
thegamedesigner  Offline OP
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Hello,

I am making the editor for my game. I want the players to be able to type in a picture file's name, (in a str, using inkey) and have the game load that picture file.

Now, how do I do this?

I have a system now, where I make and define 100 picture files, and they just replace the file with another of the same name, and this works, but is not very easy to use.

I also tried all sorts of combos of bmap* ptrs, creating and removing, etc, but I can't seem to get this to work.

Thanks for all help,


My games - www.spyeart.com
Re: User typing in a picture file, and game using it. [Re: thegamedesigner] #216343
07/16/08 16:16
07/16/08 16:16
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Manual :
Quote:

bmap_load(bmap*,string name,var mode)
Loads a bitmap from a file during gameplay.

Parameters:
bmap bitmap or bitmap pointer
name file name in .jpg, .png, .bmp, .tga, dds, or .dib format.
mode 0 = clip to old bmap size, 1 = change bmap size.

Remarks:
The file must exist in the game folder. It can not be directly read from a resource or from the folder path.
The original image can be restored by bmap_purge().
If mode is set at 0, the bmap size is unchanged. If the image file has a different size, parts of the image are clipped away or filled with black.
If mode is set at 1, the bmap must be a power of two in size.
Example:
bmap_load(bmap_for_entity(player,0),"newskin.jpg",0);

See also:
bmap_purge

I used this in a project for loading .jpg files. The only problem is that it stretches the images just a little if mode is set to 0 (Clip to old bmap size) no matter if the new image is the same width & height as the old one. But it works smile


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201

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