Skip to content
Benedict Allen edited this page Nov 17, 2015 · 1 revision

Common Problems

Here are some common problems that you might run into

My element isn't showing up.

Most likely caused by a) something else overlapping it, or b) you haven't actually added it to its desired parent.

To solve,

  • Make sure you've added it to its parent (you can do this multiple times while testing to narrow the problem down).
  • Make sure there's nothing overlapping it.

If neither of these help, just double check that it is in fact in the view by adding this code somewhere:

function element:onUpdate()
    error "I've been updated"
end

Run your code again, and if it doesn't error, the element isn't in the tree, so you've done something wrong. If it does error (meaning it is in the tree), it might be a bug, so try to narrow the problem down into a small, replicatable bit of code and submit an issue.

I've changed an element but it hasn't changed

This is most likely use through improper usage of setters. If it's an inbuilt element, make sure you made the change with setX() or setWidth() or whatever you changed. If it's a custom one, make sure you called setChanged() at some point in your setter. Note that changing Style defaults isn't designed to affect currently created styles, although its behaviour is untested, so it might work.

Just to go over this, remember to do the following:

element:setX( X )

instead of this:

element.x = X

All my elements are one right and one down from the top left of the screen.

Remember that Sheets uses a 0-based coordinate system. 0, 0 is the top left, and 1, 1 is one down and one across from the origin.

Clone this wiki locally