PiBoSo Official Forum

GP Bikes => Mods => Plugins => Topic started by: sdecorme on December 16, 2016, 06:42:08 AM

Title: draw a number on the scree
Post by: sdecorme on December 16, 2016, 06:42:08 AM
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
Title: Re: draw a number on the scree
Post by: HornetMaX on December 16, 2016, 07:23:09 AM
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.
Title: Re: draw a number on the scree
Post by: sdecorme on December 16, 2016, 10:53:45 AM
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.
Title: Re: draw a number on the scree
Post by: HornetMaX on December 16, 2016, 11:45:22 AM
Either you create a quad and add a sprite to it (it's just a .tga file) or you use a string and sprintf.
Title: Re: draw a number on the scree
Post by: sdecorme on December 16, 2016, 12:48:18 PM
I will look to g??gle to see what is a quad or a sprite.
Title: Re: draw a number on the scree
Post by: HornetMaX on December 16, 2016, 12:58:34 PM
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.
Title: Re: draw a number on the scree
Post by: sdecorme on December 16, 2016, 01:16:52 PM
Ok I will look at it tonight.
Thanks you