From a620ddc2f7c681438da95d0539ab84a4883fb759 Mon Sep 17 00:00:00 2001 From: qeffects Date: Wed, 21 Jul 2021 22:02:41 +0300 Subject: [PATCH] Added element methods to docs --- docs/core/Element.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/core/Element.md b/docs/core/Element.md index b695ace..26cf0bd 100644 --- a/docs/core/Element.md +++ b/docs/core/Element.md @@ -85,3 +85,24 @@ end) elementFactory({x = 10}, 10, 10) ``` + +### Methods + +The element has a few methods meant for user interaction, these are: + +`Element:draw(x, y, w, h)` + +Use this to draw something onscreen, you can also call this every frame if it's something that moves with your game objects +This checks equality to the current viewport so it'll only get re-rendered if something actually changes, furthermore translations don't cause re-renders. + +--- + +`Element:destroy()` + +Use destroy to remove this element from the scene + +--- + +`Element:setParam(newParam)` + +Use setParam to pass new parameters to this element