Extention New(blah:String) allowed or not?

About Monkey 2 Forums Monkey 2 Programming Help Extention New(blah:String) allowed or not?

This topic contains 3 replies, has 3 voices, and was last updated by  Diffrenzy 1 year, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11048

    Diffrenzy
    Keymaster

    Should the above code work, is it wrong, or is adding an overloaded New() via  Extention not allowed?

    #11049

    nerobot
    Participant

    I think will be better to add this constructor to Color struct.

    Looks like we can’t add constructors via extensions.

    But you can add function:

    and use it this way: Local color:=Color.Parse( "#FF5588" ).

    #11050

    Mark Sibly
    Keymaster

    Not currently allowed.

    #11061

    Diffrenzy
    Keymaster

    Thanks, I’ll go the Color.Create() route.

    If you get around to it , a Ctor that takes #ffffffff and #ffffff params would be nice.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.