Author Topic: DrawText help.  (Read 1075 times)

0 Members and 1 Guest are viewing this topic.

Offline AquaByrd

  • Soldier
  • **
  • Posts: 108
  • Lolwut?
DrawText help.
« on: February 06, 2009, 02:21:49 pm »
I'm working on a Military Ranks leveling system, but I've hit a snag already.

When you kill someone I want it to say + 5 in the centre of the screen CoD4 style, but the + 5 doesn't show up. Any idea why it doesn't show up?

Here's the code:

Code: [Select]
Procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
Begin
DrawText(Killer,'+ 5',100,RGB(255,255,255),0.1,320,240);
End;
My sig was 300 x 120, the maximum size is 300 x 125. Check next time will you.

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: DrawText help.
« Reply #1 on: February 06, 2009, 02:28:12 pm »
the killa message ("You killed Major") overdraws your custom drawtext, because you can only have one drawtext on the screen at the same time, and that includes the built-in big texts (kills, caps, bonus pickups).

A workaround could be to set a flag variable onkill and do drawtext in apponidle if the flag is set. This will create a delay up to 1 second, but its one of the few ways to do this (and prolly the safest one)

Offline AquaByrd

  • Soldier
  • **
  • Posts: 108
  • Lolwut?
Re: DrawText help.
« Reply #2 on: February 06, 2009, 03:13:09 pm »
That's odd. You say it doesn't work for OnFlagCap either, but the + 20 appears fine there.
My sig was 300 x 120, the maximum size is 300 x 125. Check next time will you.

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: DrawText help.
« Reply #3 on: February 06, 2009, 04:16:19 pm »
im not sure at what point the onflagscore procedure is called (before or after drawing the text), as i've not tried drawing anything inside it. But onplayerkill is known to be called before the kill message is drawn

Offline AquaByrd

  • Soldier
  • **
  • Posts: 108
  • Lolwut?
Re: DrawText help.
« Reply #4 on: February 06, 2009, 04:28:05 pm »
Right, ok. Damn, why can't OnPlayerKill be called after DrawText aswell. That would make life simpler.
My sig was 300 x 120, the maximum size is 300 x 125. Check next time will you.


Offline AquaByrd

  • Soldier
  • **
  • Posts: 108
  • Lolwut?
Re: DrawText help.
« Reply #6 on: February 07, 2009, 08:47:46 am »
Ahh, fair enough.
My sig was 300 x 120, the maximum size is 300 x 125. Check next time will you.