Create account / Log in

How to have multiple layers

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

How to have multiple layers

Postby davebliz » August 14th, 2019, 7:41 am

I want to have a turn counter that the person just right clicks on the counter to increase or decrease the turn number. I'm new at this. I've tried multiple layers but it's not working. I've got several images, ie turn 1, turn 2, turn 3.
Thanks.
davebliz
 
Posts: 6
Joined: November 16th, 2010, 7:09 pm

Re: How to have multiple layers

Postby JoelCFC25 » August 14th, 2019, 1:43 pm

Refer to one of my recent posts--use a Dynamic Property and have your Layer trait refer to that property to know which image to be displaying at any point in time.

viewtopic.php?p=57091#p57091
JoelCFC25
 
Posts: 536
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: How to have multiple layers

Postby davebliz » August 15th, 2019, 6:32 am

Joel, thanks for the help, much appreciated. I'm slowly learning the great Vassal system.
davebliz
 
Posts: 6
Joined: November 16th, 2010, 7:09 pm

Re: How to have multiple layers

Postby shilinski » August 15th, 2019, 6:46 pm

There is a simple way to implement this without needing dynamic properties or any properties at all. You don't need multiple layers; just one will do. Here's how:

Create your turn counter piece. It should probably be in an at-start stack on your main window. Add to it ONE Layer trait.

Edit the Layer trait. Turn on "Always Active" because if you don't, you will need to always activate your piece before you use it. Leave the rest of the on/off switches off.

Add commands for "Increase Level" and "Decrease Level." For example, you could define "Add" as control-A and "Subtract" as control-S. These commands will appear in the turn counter's right-click menu.

Near the bottom you should see a place to add an image. Add the image for your first turn. Next click on "Add Level." This will add another place to add another image. Add your second-turn image. Keep doing this until you have added all your turn images. You will end up with a list of images corresponding to the levels. You can review them by clicking on the image labels to the right.

You are done. When you run your module, you can right-click on your turn counter and select "add" to advance it to the next turn.
shilinski
 
Posts: 81
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: How to have multiple layers

Postby davebliz » August 16th, 2019, 7:34 am

Thanks to both Joel and shilinski, I can make use of both techniques. This is a great community to help new comers like myself. I remember programming in a new language back in the early 1990s and running into problems and only having books to try to find the answers
davebliz
 
Posts: 6
Joined: November 16th, 2010, 7:09 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 0 guests