Author Topic: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux  (Read 2227 times)

0 Members and 1 Guest are viewing this topic.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
eC made those functions that allowed you to have more than 1 layer of DrawText() and a fixed text on screen(InterfaceText or however it was called) in this new version that was somehow lost. Those were on of the few that really made me happy thus I'd like that stuff back.

Details:
DrawText's with different layer numbers don't make each other disappear.
Soldat is using one layer for the "You killed..." etc. and it should be possible to overwrite that if someone wishes to.

InterfaceText puts a fixed text on screen that stays there until overwrote.
It uses same layer magic as DrawText would(not sure if Soldat uses a layer for stuff like F1 menu)

Don't know what else I could say so I'm not going to. Thanks for sacrificing your valuable time reading my post.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #1 on: February 13, 2012, 09:46:28 am »
oh the long lost copy of nsc's soldatserver i wish he'd sent that to shoozza when he asked him;< +1

Im chill like that

Offline Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #2 on: February 13, 2012, 05:03:19 pm »
1) show me example scripts
2) explain the different cases and how they would work
3) max count of layers?

@bone true :/
Rules
Tools: ARSSE - SARS - SRB - chatMod

Offline Tehbugerz0r

  • Soldier
  • **
  • Posts: 158
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #3 on: February 14, 2012, 01:36:22 pm »
1) show me example scripts
2) explain the different cases and how they would work
3) max count of layers?

1:
Quote from: eC Scripting Manual
procedure InterfaceText(ID,ItemID: Byte;Text: String;X,Y: Word;Color: LongInt;InServerMenu: boolean;FontID: byte;Scale: Single);

Parameter Info:
  ID (Byte): Player ID to send this text to.
  ItemID (Byte): ID for the interface item, number from 1 to 10. See description for more info.
  Text (String): Text to draw on the players screen.
  X,Y (Word): X,Y coordinates where you want the text to appear. Maximum 640/480
  Color (LongInt): Color for the text. Can be alpha transparent, using the ARGB function.
  InServerMenu (Boolean): True/False if you want this text to only be visible when the F11 Server Menu is open.
  FontID (Byte): Font ID to use for the text drawing. See description for examples
  Scale (Single): Scale to use for the text. Default 1.0

Description:
This function will write the specified text on the players interface. The ItemID parameter is shared between all the Interface/World Text/Image functions, meaning if you use ItemID 3 for InterfaceText, and then use the same ItemID 3 for WorldImage, the text you drew with InterfaceText will be replaced with the WorldImage image.
Any text you draw will remain wherever you drew it until you call this function again with the Text parameter set to a blank string and the ItemID of the one you want to remove. This text is not removed when a map changes.

FontID Examples.... (All using default 1.0 Scale)

Not much difference except boldness, font size, and shadows.

2: I never got to use interface text but from the main post I think it works the same as draw text but it does not move with the player's screen and does not disappear until overwritten, see item ID above.

3: The layers thing he's talking about is the ability to use drawtext several times without overwriting each other, and not removing the default text.

Are you still working on script core?

Bonecrusher: He should be shot for keeping it to himself.

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #4 on: February 14, 2012, 03:31:34 pm »
same thing about WorldText
Quote
procedure WorldText(ID,ItemID: Byte;Text: String; X,Y: Single;Color: LongInt;FontID: byte;Scale: Single);

Parameter Info:
  ID (Byte): Player ID to send this text to.
  ItemID (Byte): ID for the interface item, number from 1 to 10. See description for more info.
  Text (String): Text to draw on the players screen.
  X,Y (Single): X,Y world coordinates where you want the text to appear.
  Color (LongInt): Colour for the text. Can be alpha transparent, using the ARGB function.
  FontID (Byte): Font ID to use for the text drawing. See description for examples
  Scale (Single): Scale to use for the text. Default 1.0

Description:
This function will write the specified text at the specified world XY. "World XY" means the coordinates of an area on the entire map. The ItemID parameter is shared between all the Interface/World Text/Image functions, meaning if you use ItemID 3 for WorldText, and then use the same ItemID 3 for InterfaceImage (or any other Interface/World function), the text you drew with WorldText will be replaced with the InterfaceImage image.
Any text you draw will remain wherever you drew it until you call this function again with the Text parameter set to a blank string and the ItemID of the one you want to remove.
All World/Interface text is automatically removed when a map changes.

Also, having that stuff limited to certain (low) amount of layers doesn't sound like a great idea, some other solution would be nice.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #5 on: February 15, 2012, 04:54:51 am »
I mailed nsc

Quote from: Nick Cooper
Those functions took maybe an hour to implement solo, the new devs
should be able to do it in no time. It is just a bunch of text arrays
and functions that already existed in the source. I don't have a copy of
my code any more.

Im chill like that

Offline Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #6 on: February 16, 2012, 03:29:17 am »
Are you still working on script core?
I didn't work on the script core a lot. Actually most stuff I did was fixing small bugs not adding new stuff.

Also, having that stuff limited to certain (low) amount of layers doesn't sound like a great idea, some other solution would be nice.
Whats the 'other solution'?

I mailed nsc

Quote from: Nick Cooper
Those functions took maybe an hour to implement solo, the new devs
should be able to do it in no time. It is just a bunch of text arrays
and functions that already existed in the source. I don't have a copy of
my code any more.
Good to know that there is not use to ask him for the old source anymore.
Rules
Tools: ARSSE - SARS - SRB - chatMod

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #7 on: February 16, 2012, 06:01:05 am »
Also, having that stuff limited to certain (low) amount of layers doesn't sound like a great idea, some other solution would be nice.
Whats the 'other solution'?
tk desires infinity I guess.

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #8 on: February 16, 2012, 02:34:36 pm »
Well, for me it may be done in ANY working way, just saying that too strict limit (like EnEsCe's 10) wouldn't be nice. It was just unnecessary limitation, causing problems in scripts such as Gizd's damage display for example.

Offline Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: [SCRIPTCORE] Interface text / Drawtext layers aka stuff that doesn't sux
« Reply #9 on: February 16, 2012, 03:39:41 pm »
Hmm so 50 would be ok I guess.
Rules
Tools: ARSSE - SARS - SRB - chatMod