Properties example code pls?

About Monkey 2 Forums Monkey 2 Programming Help Properties example code pls?

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  kinetic 1 year, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9483

    kinetic
    Participant

    Hi,

    I can’t quite work out how to  use properties based on the doc code, any small example of read/write props pls?

    #9489

    TomToad
    Participant

    This example creates a vector class in which the vector can be stored as direction/magnitude, or as x/y. Internally, it is stored the same way so uses properties to convert between the two. This is handy as it allows you to change implementation behind the scenes without needing to change the interface as well.

    #9505

    kinetic
    Participant

    Thanks, works.

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

You must be logged in to reply to this topic.