View previous topic :: View next topic |
Author |
Message |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Mon Mar 01, 2010 12:50 am Post subject: SLICES ARE AWESOME!!!! |
|
|
I can't get over how awesome they are. They're so easy to use too! (so far).
They'll be even awesome'r when multi-threading kicks in.
Saminaster has a new power :-)
Okay, um, question.
When you use "load attack sprite", is it possible to load the 2nd or 3rd frame of an attack? Likewise, is it possible to load a picture that isn't the "standing" frame for a hero? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Mar 01, 2010 8:36 am Post subject: |
|
|
Certainly! Check out the "set sprite frame" command.
Slices are so much fun :) |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Mon Mar 01, 2010 8:18 pm Post subject: |
|
|
Splendid!
Hey - I noticed a Y-sort children command for slices ...
Is there an easy way to Y-sort according to the bottom coord of the slice?
I guess you could put slices on the "sorter slice", assign a sprite to each sub-slice, and position the sprites so that their bottom aligns with the top of their parent.
Is that the easiest/only way?
Also, what is the purpose of assigning a size to a slice? Does it restrict where you can tack on other slices? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Mar 02, 2010 2:34 am Post subject: |
|
|
Bagne wrote: | Hey - I noticed a Y-sort children command for slices ...
Is there an easy way to Y-sort according to the bottom coord of the slice?
I guess you could put slices on the "sorter slice", assign a sprite to each sub-slice, and position the sprites so that their bottom aligns with the top of their parent.
Is that the easiest/only way? |
Admittedly y sort children does things the wrong way and is often useless. You will want to use the general slice sorting command, sort children. First you assign each child slice an value with set sort order, like so:
Code: | script, bottom y sort children, parent, begin
variable (sl)
sl := first child (parent)
while (sl) do (
set sort order (sl, slice y (sl) + slice height (sl))
sl := next sibling (sl)
)
sort children (parent)
end |
Quote: | Also, what is the purpose of assigning a size to a slice? Does it restrict where you can tack on other slices? |
I assume you're talking about changing the size of a container slice, because you can't change the size of a sprite slice, and the size of all the other slices has an obvious function.
The size of a container slice affects children which are aligned with its bottom and right edges, and slice which are set to Fill their parent (which automatically sets their size and position) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Mar 02, 2010 8:03 am Post subject: |
|
|
This reminds me that I want to add these commands:
Code: |
script, slice edge y, sl, edge, begin
switch(edge) do(
case(edge:top) do(exit returning(slice y(sl)))
case(edge:center) do(exit returning(slice y(sl) + slice height(sl) / 2))
case(edge:bottom) do(exit returning(slice y(sl) + slice height(sl) -- 1))
)
end
script, slice edge x, sl, edge, begin
switch(edge) do(
case(edge:left) do(exit returning(slice x(sl)))
case(edge:middle) do(exit returning(slice x(sl) + slice width(sl) / 2))
case(edge:right) do(exit returning(slice x(sl) + slice width(sl) -- 1))
)
end
script, set slice edge y, sl, edge, val, begin
switch(edge) do(
case(edge:top) do(set slice y(sl, val))
case(edge:center) do(set slice y(sl, val -- slice height(sl) / 2))
case(edge:bottom) do(set slice y(sl, val -- slice height(sl) -- 1))
)
end
script, set slice edge x, sl, edge, val, begin
switch(edge) do(
case(edge:left) do(set slice x(sl, val))
case(edge:middle) do(set slice x(sl, val -- slice width(sl) / 2))
case(edge:right) do(set slice x(sl, val -- slice width(sl) -- 1))
)
end
|
I needed them in Don't Eat Soap, and I need them in Bell of Chaos.
It is nice to be able to leave the slice anchored and aligned by the top left corner, but to still reposition it or check collision points based on other edges and corners. |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Wed Mar 03, 2010 12:48 pm Post subject: |
|
|
James Paige wrote: | Bell of Chaos. |
What's this?! |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Mar 03, 2010 1:08 pm Post subject: |
|
|
Spoon Weaver wrote: | James Paige wrote: | Bell of Chaos. |
What's this?! |
Bell of Chaos is my deliciously slice-filled entry for the 8-bit contest. Playable demo with source code to be uploaded friday >:) |
|
Back to top |
|
 |
Baconlabs PURPLE IS MANLY

Joined: 15 Mar 2009 Posts: 335 Location: Tennessee
|
Posted: Wed Mar 03, 2010 7:51 pm Post subject: |
|
|
James Paige wrote: | Bell of Chaos is my deliciously slice-filled entry for the 8-bit contest. Playable demo with source code to be uploaded friday >:) |
Cue a wave of shock and awe from the audience.
 |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sat Apr 03, 2010 6:30 am Post subject: |
|
|
Haha ... I ask all these questions, and now, months later, I finally get around to using this y-sorting.
Anyways, thanks! _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
|