Class: Shoes::Native
- Inherits:
-
Object
- Object
- Shoes::Native
- Defined in:
- lib/blue_shoes/native.rb
Instance Method Summary collapse
-
#displace(left, top) ⇒ Object
Displacing an element moves it.
-
#height ⇒ Object
The vertical screen size of the element in pixels.
-
#hide ⇒ Object
Hides the element, so that it can’t be seen.
-
#left ⇒ Object
Gets you the pixel position of the left edge of the element.
-
#move(left, top) ⇒ Object
Moves the element to a specific pixel position within its slot.
-
#parent ⇒ Object
Gets the object for this element’s container.
-
#remove ⇒ Object
Removes the element from its slot.
-
#show ⇒ Object
Reveals the element, if it is hidden.
-
#style(styles) ⇒ Object
Changes the style of an element.
-
#toggle ⇒ Object
Hides an element if it is shown.
-
#top ⇒ Object
Gets the pixel position of the top edge of the element.
-
#width ⇒ Object
Gets the pixel width for the full size of the element.
Instance Method Details
#displace(left, top) ⇒ Object
Displacing an element moves it. But without changing the layout around it. This is great for subtle animations, especially if you want to reserve a place for an element while it is still animating. Like maybe a quick button shake or a slot sliding into view.
5 6 7 8 |
# File 'lib/blue_shoes/native.rb', line 5 def displace(left, top) #returns self throw NotImplementedError end |
#height ⇒ Object
The vertical screen size of the element in pixels. In the case of images, this is not the full size of the image. This is the height of the element as it is shown right now.
11 12 13 14 |
# File 'lib/blue_shoes/native.rb', line 11 def height # returns a number throw NotImplementedError end |
#hide ⇒ Object
Hides the element, so that it can’t be seen. See also show and toggle.
17 18 19 20 |
# File 'lib/blue_shoes/native.rb', line 17 def hide # returns self throw NotImplementedError end |
#left ⇒ Object
Gets you the pixel position of the left edge of the element.
23 24 25 26 |
# File 'lib/blue_shoes/native.rb', line 23 def left # returns a number throw NotImplementedError end |
#move(left, top) ⇒ Object
Moves the element to a specific pixel position within its slot. The element is still inside the slot. But it will no longer be stacked or flowed in with the other stuff in the slot. The element will float freely, now absolutely positioned instead.
29 30 31 32 |
# File 'lib/blue_shoes/native.rb', line 29 def move(left, top) # returns self throw NotImplementedError end |
#parent ⇒ Object
Gets the object for this element’s container. Also see the slot’s contents to do the opposite: get a container’s elements.
35 36 37 38 |
# File 'lib/blue_shoes/native.rb', line 35 def parent # returns a Shoes::Stack or Shoes::Flow throw NotImplementedError end |
#remove ⇒ Object
Removes the element from its slot. (In other words: throws it in the garbage.) # The element will no longer be displayed.
41 42 43 44 |
# File 'lib/blue_shoes/native.rb', line 41 def remove # returns self throw NotImplementedError end |
#show ⇒ Object
Reveals the element, if it is hidden. See also hide and toggle.
47 48 49 50 |
# File 'lib/blue_shoes/native.rb', line 47 def show # returns self throw NotImplementedError end |
#style(styles) ⇒ Object
Changes the style of an element. This could include the :width and :height of an element, the font :size of some text, the :stroke and :fill of a shape. Or any other number of style settings.
53 54 55 56 |
# File 'lib/blue_shoes/native.rb', line 53 def style # returns styles throw NotImplementedError end |
#toggle ⇒ Object
Hides an element if it is shown. Or shows the element, if it is hidden.
65 66 67 68 |
# File 'lib/blue_shoes/native.rb', line 65 def toggle # returns self throw NotImplementedError end |
#top ⇒ Object
Gets the pixel position of the top edge of the element.
71 72 73 74 |
# File 'lib/blue_shoes/native.rb', line 71 def top # returns a number throw NotImplementedError end |
#width ⇒ Object
Gets the pixel width for the full size of the element. This method always returns an exact pixel size. In the case of images, this is not the full width of the image, just the size it is shown at. See the height method for more.
77 78 79 80 |
# File 'lib/blue_shoes/native.rb', line 77 def width # returns a number throw NotImplementedError end |