gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfxgfx
 
Members, please note that our guidelines are located here.
 
gfx gfx
gfx
484586 Posts in 28410 Topics by 2464 Members - Latest Member: austinrobert July 11, 2020, 07:37:53 PM
*
gfx* Home | Help | Calendar | Login | Register | gfx
gfx
The Gaming Universe  |  The Archives  |  Archived Projects  |  Open Zelda  |  OZ Help (Moderator: red_team316)  |  public function defaults?
gfx
gfxgfx
 

Author Topic: public function defaults?  (Read 687 times)

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
public function defaults?
« on: June 20, 2010, 07:15:58 PM »
Is it possible to set default values for public functions?
 
public AdvanceText(string[], x, y, sty = 1, red = 255, green = 255, blue = 255, alpha = 255, size = 200, depth = -1, l = 0, cap = true)

Take that for example, is it possible?
The only other way I know is to use if statements to find out if one of those options is Null.

Offline Luke

  • Regimental
  • ****
  • Posts: 1,823
    • View Profile
Re: public function defaults?
« Reply #1 on: June 20, 2010, 07:47:01 PM »
Do the same as RPGlibs does, and wrap the callfunction in a Stock Function, plus you get the benefit that the wrong argument can't be passed.

Code: [Select]
stock AdvanceText(string[], x, y, sty = 1, red = 255, green = 255, blue = 255, alpha = 255, size = 200, depth = -1, l = 0, cap = true)
{
  CallFunction(.....);
}
« Last Edit: June 20, 2010, 07:48:48 PM by Luke »

Offline KingOfHumans

  • Messiah
  • ******
  • Posts: 17,866
    • View Profile
Re: public function defaults?
« Reply #2 on: June 20, 2010, 10:19:52 PM »
Never thought about doing that.
Thanks for the advice.

The Gaming Universe  |  The Archives  |  Archived Projects  |  Open Zelda  |  OZ Help (Moderator: red_team316)  |  public function defaults?
 

gfxgfx
gfx
SMF 2.0.17 | SMF © 2019, Simple Machines Page created in 0.223 seconds with 24 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!
anything