• Welcome to PiBoSo Official Forum. Please login or sign up.
 
March 28, 2024, 06:40:59 PM

News:

GP Bikes beta21c available! :)


draw a number on the scree

Started by sdecorme, December 16, 2016, 06:42:08 AM

Previous topic - Next topic

sdecorme

Hi,
I need to draw a number on the screen during playing. In the dll I've found the draw function, where can I find informations about it ?
Thanks you

HornetMaX

Everything you need is in the example code (gpb_example.c).
Look ad DrawInit(), Draw() plus the structures SPluginString_t and SPluginQuad_t.
You can find one font file in one of GPB's .pkz (can't rememebr wich one exactly, but somewhere there's a main.fnt) or in my plugin data directory.

sdecorme

Hi,
I've found all the function in the sample, and the font in your code.
I've never made code with graphic parameters and I don't understand how to use the differrent structure.
I just need to write 10 in big in red  in the middle of the screen.

HornetMaX

Either you create a quad and add a sprite to it (it's just a .tga file) or you use a string and sprintf.

sdecorme

I will look to g??gle to see what is a quad or a sprite.

HornetMaX

Quote from: sdecorme on December 16, 2016, 12:48:18 PM
I will look to g??gle to see what is a quad or a sprite.
A quad is "a rectangle on the screen": you can fill it with a fixed color, or put a sprite (a .tga image) on it.

For GPB, a quad is SPluginQuad_t and a (graphical) string is SPluginString_t.

You don't need google.

sdecorme

Ok I will look at it tonight.
Thanks you