Author Topic: What is the best way to make a side panel that spans the height of the screen  (Read 4571 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
The stripe panel is made of one tiled sprite and a few normal or split sprites and these elements are all under one panel.
1- how do I size the panel so its top and bottom sticks to the top and bottom of the screen (a sort of size anchor)?
2- how do I scale the panel in a way that doesn't deform the way the sprites look but only resize the childrens (so the stripe pattern doesn't stretch but the rectangle that holds it resizes)

 https://www.youtube.com/watch?v=-BzrFWxqD9A

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Use a UITiledSprite and put a UIStretch script directly on it.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Thanks that works.

How do I also stretch the draggable panel to fit the screen's height ?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
You have to do a custom script for that and set the clipRange on the UPanel.