Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

SLICES ARE AWESOME!!!!

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Mon Mar 01, 2010 12:50 am    Post subject: SLICES ARE AWESOME!!!! Reply with quote

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
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Mon Mar 01, 2010 8:36 am    Post subject: Reply with quote

Certainly! Check out the "set sprite frame" command.

Slices are so much fun :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Mon Mar 01, 2010 8:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Mar 02, 2010 2:34 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Mar 02, 2010 8:03 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Wed Mar 03, 2010 12:48 pm    Post subject: Reply with quote

James Paige wrote:
Bell of Chaos.


What's this?!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Mar 03, 2010 1:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Baconlabs
PURPLE IS MANLY




Joined: 15 Mar 2009
Posts: 335
Location: Tennessee

PostPosted: Wed Mar 03, 2010 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bagne
ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA




Joined: 19 Feb 2003
Posts: 518
Location: Halifax

PostPosted: Sat Apr 03, 2010 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group