Author Topic: draw a number on the scree  (Read 630 times)

sdecorme

  • Newbie
  • *
  • Posts: 41
    • View Profile
draw a number on the scree
« 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

HornetMaX

  • Hero Member
  • *****
  • Posts: 5616
    • View Profile
Re: draw a number on the scree
« Reply #1 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.

sdecorme

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: draw a number on the scree
« Reply #2 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.
 

HornetMaX

  • Hero Member
  • *****
  • Posts: 5616
    • View Profile
Re: draw a number on the scree
« Reply #3 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.

sdecorme

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: draw a number on the scree
« Reply #4 on: December 16, 2016, 12:48:18 PM »
I will look to g??gle to see what is a quad or a sprite.

HornetMaX

  • Hero Member
  • *****
  • Posts: 5616
    • View Profile
Re: draw a number on the scree
« Reply #5 on: December 16, 2016, 12:58:34 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

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: draw a number on the scree
« Reply #6 on: December 16, 2016, 01:16:52 PM »
Ok I will look at it tonight.
Thanks you