https://github.com/jaliborc/poncho-2.0
A library for implementing object-oriented frame classes with inheritance in World of Warcraft.
https://github.com/jaliborc/poncho-2.0
library lua object-oriented-programming world-of-warcraft
Last synced: 6 months ago
JSON representation
A library for implementing object-oriented frame classes with inheritance in World of Warcraft.
- Host: GitHub
- URL: https://github.com/jaliborc/poncho-2.0
- Owner: Jaliborc
- Created: 2011-12-14T18:46:24.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-08-09T05:03:42.000Z (11 months ago)
- Last Synced: 2024-08-09T06:24:13.607Z (11 months ago)
- Topics: library, lua, object-oriented-programming, world-of-warcraft
- Language: Lua
- Homepage:
- Size: 39.1 KB
- Stars: 6
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Poncho-2.0 :running_shirt_with_sash:
[](https://www.patreon.com/jaliborc)
[](https://www.paypal.me/jaliborc)
[](https://bit.ly/discord-jaliborc)A library for implementing object-oriented frame classes with inheritance in World of Warcraft.
Simulating frame classes in World of Warcraft is not simple: Lua does not support classes by default and frames cannot be deallocated once created. Even further, frames can be assigned to `xml` templates and global names, which cannot be changed once set. Recently, Blizzard added APIs for handling classes as mixins, but they also come with their own set of limitations.
### Overview
Creating frames in World of Warcraft is extremely simple:
````lua
frame = CreateFrame('Frame', 'SomeFrame', SomeParent, 'SomeTemplate')
````Creating a new frame class using Poncho is very similar:
````lua
class = LibStub('Poncho-2.0'):NewClass('Frame', 'FrameNames', 'SomeTemplate')
````Frames can then be created by calling the class object itself:
````lua
frame = class()
````Subclasses then can be recursively inherited:
````lua
sublass = class:NewClass()
````Classes also behave as frame pools, so frames can be released:
````lua
frame = class()
frame:Release()
````### More Information
For a quick guide on writting classes using Poncho and an API reference check [the wiki](https://github.com/Jaliborc/Poncho-2.0/wiki).
If you use this library, please list it as one of your dependencies in the CurseForge admin system. It's a big help! :+1: