×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Function] addTextAreaEx
[Function] addTextAreaEx
Laagaadoo
« Citoyen »
1390759800000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
Hello, today I present the [url=]addTextAreaEx[/url] function.

• What it does?
This function creates a Text Area with the X and Y in the center.

• How to use?
[url=]addTextAreaEx[/url](Int _id, String _text, String _targetPlayer, Int _x, Int _y, Int _width, Int _height, Int _backgroundColor, Int _borderColor, Float _opacity, Boolean _fixed)


[img]http://transformiceplus.tk/negrito/?t=- Arguments[/img]
_id - The ID of the Text Area, you can only put numbers, otherwise the Text Area will not be displayed.
_text - The text that will be displayed.
_targetPlayer - The name of the player that will see the Text Area, use nil to display to all players.
_x - The X of the Text Area, remember that the X will be the center in the horizontal of the Text Area.
_y - The Y of the Text Area, remember that the Y will be the center in the vertical of the Text Area.
_width - The width of the Text Area, only numbers, otherwise the Text Area will not be displayed.
_height - The height of the Text Area, only numbers, otherwise the Text Area will not be displayed.
_backgroundColor - The background color of the Text Area.
_borderColor - The border color of the Text Area.
_opacity - The opacity of the Text Area, only numbers (decimal numbers too), otherwise the Text Area will not be displayed.
_fixed - Optional. Determines if the Text Area will be fixed in the screen or no, if you put nothing, automatically it assign the false value.

• Image

http://i.imgur.com/qbcymTW.png
a dit :
[url=]An example of the Text Area created with the X 400 and the Y 200.[/url]

• LUA Script
You can find the script here.
Safwanrockz
« Censeur »
1390760280000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Very helpful! Thanks.
Benbirkralm
« Citoyen »
1390762980000
    • Benbirkralm#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Thank you.
Masddss
« Citoyen »
1390837740000
    • Masddss#0000
    • Profil
    • Derniers messages
    • Tribu
#4
  0
id - The ID of the Text Area, you can only put numbers, otherwise the Text Area will not be displayed.
_text - The text that will be displayed.
_targetPlayer - The name of the player that will see the Text Area, use nil to display to all players.
_x - The X of the Text Area, remember that the X will be the center in the horizontal of the Text Area.
_y - The Y of the Text Area, remember that the Y will be the center in the vertical of the Text Area.
_width - The width of the Text Area, only numbers, otherwise the Text Area will not be displayed.
_height - The height of the Text Area, only numbers, otherwise the Text Area will not be displayed.
_backgroundColor - The background color of the Text Area.
_borderColor - The border color of the Text Area.
_opacity - The opacity of the Text Area, only numbers (decimal numbers too), otherwise the Text Area will not be displayed.
_fixed - Optional. Determines if the Text Area will be fixed in the screen or no, if you put nothing, automatically it assign the false value.
Zutto
« Citoyen »
1390846440000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Wooow thank you!!
Zebraishere
« Citoyen »
1390850940000
    • Zebraishere#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  0
PEW PEW PEW PEW
Kmlcan
« Citoyen »
1390852680000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Nice one. you could change the original textArea with this, by adding a "center" option after fixed option.

I mean like this one;
a dit :
ui.addTextArea(id, text, target, nil, nil, width, height, color, color, opacity, fixed, center)

Hope you'll improve this. :3
Evilsantah
« Citoyen »
1390854120000
    • Evilsantah#0000
    • Profil
    • Derniers messages
#8
  0
Evilsantah a dit :

ui._addTextArea = ui.addTextArea

function ui.addTextArea(id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos, center)
if center then
x = x - width/2
y = y - height/2
end
ui._addTextArea(id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos)
end

This should work exactly the same but with a center boolean.
Safwanrockz
« Censeur »
1390854360000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Evilsantah a dit :
This should work exactly the same but with a center boolean.

Shorter and more functional.
Poukidev
« Citoyen »
1390923900000
    • Poukidev#0000
    • Profil
    • Derniers messages
    • Tribu
#10
  0
You can use that too :
a dit :


ui._addTextArea = ui.addTextArea

function ui.addTextArea(id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos, center)
x = center and x - width/2 or x
y = center and y - height/2 or y

ui._addTextArea(id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos)
end

 
Evilsantah
« Citoyen »
1390930680000
    • Evilsantah#0000
    • Profil
    • Derniers messages
#11
  0
Poukidev a dit :
You can use that too :
 

How does that even work?
Poukidev
« Citoyen »
1391079240000
    • Poukidev#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  0
This is ternaires conditions? :x
Moepl
« Citoyen »
1391080560000
    • Moepl#0095
    • Profil
    • Derniers messages
#13
  0
Poukidev a dit :
This is ternaires conditions? :x

yes
http://lua-users.org/wiki/TernaryOperator

(Personally, I don't like it how it is done in lua and don't use it)
Evilsantah
« Citoyen »
1391081700000
    • Evilsantah#0000
    • Profil
    • Derniers messages
#14
  0
Poukidev a dit :
This is ternaires conditions? :x

Well yeah, you just edited the code now. It looked a lot different when I posted.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Function] addTextAreaEx
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27