Post new topic    
Page «  1, 2
Metal King Slime
Send private message
 
 PostThu Feb 13, 2020 4:38 pm
Send private message Reply with quote
My guess is that "free slice (screen menu)" appears to do nothing because you have loaded the slice collection multiple times, which can happen if you load it e.g. in map autorun scripts instead of the new game script. Each time you load it, a new set of slices is created, and it will exactly overlap the previously loaded menu slices if they already existed, so you can't see the difference. Use the slice debugger/in-game slice editor (Ctrl-F4) to check if this is happening.

If this is the problem, then you need to be careful not to load it multiple times. You could write:
Code:
if (screen menu == 0) then (screen menu := load slice collection (##))

and write "screen menu := 0" whenever you delete the screen menu slice. (By the way, in "General Game Settings -> Saved Games", turn on "Save script/sprite layer slices")
Or, you could use "lookup slice" to check whether the slice already exists.

The only other possible cause is that "screen menu" doesn't contain the correct slice handle. You should have written "screen menu:= load slice collection (##)" when loading it.

You can use "lookup slice" on a loaded slice collection. (Note that once a slice collection is loaded, it's no different from any other set of slices. The engine doesn't record that they were part of a slice collection.)
In the slice collection editor, press F5. This will show the root slice of the collection. "load slice collection" returns a handle to a copy of the root slice. Give this slice a lookup code, then you can use "lookup slice" to get a handle to the collection after loading it, even if you didn't save the handle returned by "load slice collection".
Slime
Send private message
Question about slice scrolls 
 PostFri Mar 06, 2020 6:23 pm
Send private message Reply with quote
Thanks for you advice. I managed to deal with buffer problems and slice collection overloading
by using another way: a global variable and the switch command.

This way you have either state 0 slice collection loaded ou state 1 free slice.

I had now another question. I've made a slice collection menu and I would like to use the scroll function.
My problem is the following: when I launched the collection the sroll bar doesn't not appear.

It is said in the plotscprit dictionary that children should fill the whole slice scroll to trigger to correct behaviour.
I have put only 5 slice text.
Could someone give me advice about what to check? Screenshots may be useful...

Have a nice day!
Metal King Slime
Send private message
 
 PostSat Mar 07, 2020 1:25 am
Send private message Reply with quote
A switch with two cases like that can probably also be written as an "if".

So you want the scrollbar to appear even if you can't scroll? OK, just add an invisible (container) child slice which is the same size as the scroll slice. You might have to make it 1 pixel taller.
Slime
Send private message
Re: queston about slice scrolls 
 PostSat Mar 07, 2020 2:05 pm
Send private message Reply with quote
TMC said:
Quote:
So you want the scrollbar to appear even if you can't scroll?


Well in fact I'm would like to to make exactly like a menu.
You have an long item list which require scrolling to see all items andyou can select

Imagine a amor & weapon shop

you have the items

leather armor
cap
short sword
small shield
bronze shield
iron armor
iron shield


I would like to select the menu item using an icon (on the left side of the text)
and the ability to scroll. I try what you said an add a container but the scroll bar didn't appear.
Could you please give me more detailed information?

As always thanks for your help!
Metal King Slime
Send private message
 
 PostMon Mar 09, 2020 3:03 pm
Send private message Reply with quote
(Sorry, I've been busy)

I'm not entirely sure what you're asking, but I hope this helps.

Here's an example of a menu with a scrollbar (from Axe Cop):

Notice that the scroll slice is the parent of the menu items, and it's set to "Clip Children".


Now I've deleted slices from the bottom until the scroll bar no longer appeared. Then I added a container slice that's 1 pixel higher than the scroll slice (0x114 vs 200x113), causing the scroll bar to show again.
Slime
Send private message
I've practised a bit and... 
 PostTue Mar 10, 2020 6:40 am
Send private message Reply with quote
Thanks a lot for the screenshots. Theywere really helpfull.
I've made some test but I sill have some trouble to make appear the blue bar.... but that's definitevily an improvement.

Could you please post screenshots of the item collection details menu for the scroll bar and the container?

As always thank you very much for your help!
Metal King Slime
Send private message
 
 PostTue Mar 10, 2020 8:33 am
Send private message Reply with quote
Well, OK, here's the scroll slice.

Oh, make sure "Check depth" is set to "no limit".


Do you have the scroll slice inside another slice which is set to clip children? Maybe it's clipping off the scroll bar.

Maybe you could post a screenshot of your slice collection instead?


I won't bother to post the container slice because it's a new container slice with only the height modified, everything else including position (0,0) is default.
Slime
Send private message
Posting screenshot is a good idea! 
 PostWed Mar 11, 2020 6:48 am
Send private message Reply with quote
Thanks for the suggestion. Here are my screenshots. Sorry the size is a bit big. Click on the image or download it so that you can zoom on it.
In this one, I've added a simple rectangle slice a background.
I've spoken about a simple armory shop in my previous post, but I would like to use this in my YuGiOh game as well!







As always feel free to ask any further question above...
Metal King Slime
Send private message
 
 PostWed Mar 11, 2020 2:33 pm
Send private message Reply with quote
Look again at the first screenshot I posted. The menu items need to be children of the scroll slice, which should be the size of that rectangle slice - you probably want to make it a child of the rect slice and set the scroll scroll to Fill Parent. And the scroll slice should be the one to Clip Children, not the rect (you already have that correct).
I don't know how you've arranged your slices, because you didn't show the slice tree, but I can see that they aren't children of the scroll slice. (BTW for next time: you can export a slice collection by pressing F2.)
Slime
Send private message
Help with slice tree 
 PostWed Mar 11, 2020 4:22 pm
Send private message Reply with quote
[quote= TMC"]I don't know how you've arranged your slices, because you didn't show the slice tree, but I can see that they aren't children of the scroll slice.[/quote]

That's my problem. I don't know how to make and to use slice tree Zombie !
My scroll & rectangle slice are clipped to children but s you can see below, they are on the same level
on my slice tree.



All my slice are aligned on the same lign on the left side of the screen while the one in your screenshots aren't.
My question is therefor the following: how do I access/ make changes in my slice tree so that scroll bar appears just like
your in your screenshots ?

I've tried to press F2 but It creates a ".slice" file. What's its relation with pictures? Confused
Thanks for answering so quickly
Metal King Slime
Send private message
 
 PostThu Mar 12, 2020 2:35 am
Send private message Reply with quote
Select a slice and press Shift+Right to make it a child of the slice above it; Shift-Left does the opposite. Shift-Up/Down change the order of a slice. You can also press Ctrl-Up/Down to change the selected slice while skipping over children. Press F1 and read the controls for the editor.
Remember to make sure the scroll slice is a child of the rect slice, not the other way around.

The .slice file is useful if you want to post your slice collection when you ask for help, or want to transfer slice trees between games.

BTW, you can attach screenshots to posts here on Slime Salad (unfortunately sometimes they don't preview the image). But you could make the window smaller rather than attach huge screenshots.
Display posts from previous:
Page «  1, 2