• References
    • Main
    • RenderKit
    • LibJS
    • Canvas
  • Components
    • Overview
    • Page
    • Basic
      • Rectangle
      • Text
      • Button
      • HTML Article
      • Toggle Button
      • Tiler
      • Web View
      • Image Zoomer
    • Navigation
      • Carousel
    • Forms
      • Form
      • Text Entry
    • Layout
      • Group
  • Web API
  • Tutorials
  • Contact
Menu
  • References
    • Main
    • RenderKit
    • LibJS
    • Canvas
  • Components
    • Overview
    • Page
    • Basic
      • Rectangle
      • Text
      • Button
      • HTML Article
      • Toggle Button
      • Tiler
      • Web View
      • Image Zoomer
    • Navigation
      • Carousel
    • Forms
      • Form
      • Text Entry
    • Layout
      • Group
  • Web API
  • Tutorials
  • Contact
Umajin Developer > Nine Slice

Nine Slice

Check out the standard help for an overview of the Nine Slice component.

Internal Name

// Internally the component is known as "nine_slicer"
var slicer1 = findComponent("My Page", "rectangle", "MySlicer"); // To retrieve a nine_slicer component called "MySlicer" on a page called "My Page"
var slicer2 = findComponentInForeground("My Foreground", "rectangle", "MySlicer"); // To retrieve a nine_slicer component in the foreground.
var slicer3 = createComponent(parentComponent, "rectangle", 0, 0, 100, 100); // to create a nine_slicer component inside a custom component.

// Retrieving a property
var slice_top = getProperty(c, 'slice_top')
console.log(slice_top);
 
//Setting a property
setProperty(slicer1, "filename", "aImage.jpg"); 

// Binding an event
bindEvent(slicer3, "on_press", "action");
function action(){
    console.log("hello world");
}

Properties

See the shared property list for all properties available for this component.

PropertyTypeDescription
filenamestringThe filename of the image to show from the /images folder.
slice_top, slice_left, slice_right, slice_bottomnumber (Pixels)Used to preserve the edges of an image when resizing.
To quickly find optimal slice values, place a component using the editor and choose ‘Edit Values’.
border_scalenumberProportionally scales the sides, edges and corners of the nine slice image that are set in the editable values of the image used as a base for the component.
border_paddingnumberPads the nine slice inside to outside the object bounds.  This is useful when the nine slice object is snapped to another object and the border needs to be either internal or external of the bound object.

Events

See the shared event list for all events available for this component.

  • Developer Home
  • Umajin Home
  • Support Home
Menu
  • Developer Home
  • Umajin Home
  • Support Home