GroupLayer / UnGroupLayer

Feature requests for future versions of Hollywood can be voiced here
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

GroupLayer / UnGroupLayer

Post by Bugala »

In my programming practice project that I am doing right now, there are several boards which can have buttons on top of them (its a board game). One of the things I did to it was to make these boards movable by dragging them around with mouse.

However, There is quiet a lot of pain on that, sinceit is not enough to move the board layer, but i also need to move the buttons on top of it, or highlight effects etc.

I also encountered a situation where it had been easiest to make a duplicate of one layer temporarily, but i had to abandon that idea when i realised i would need to take this duplicate layer into account if this board is being moved.


Hence what I have started really to want as a solution, would be to have GroupLayer command.

This could work in one of two ways:

Code: Select all

GroupLayer(ID_Layer1, ID_Layer2)
Where ID_Layer1 is the layer to be attached to the ID_Layer2.

After this, if you would put for example showlayer(ID_Layer2, x, y) then Both layers would move accordingly.


Second way:

Code: Select all

CreateLayerGroup(ID_Group, ID_Layer)
GroupLayer(ID_Group, ID_Layer)
In this one you would create ID_Group using for ID_Layer as the Layer upon which all other layers x and y etc. are compared to.
Then when you wish to attach more layers to this group, you would use GroupLayer Command by giving the groups ID and Layer to be attached ID.

First ones advantage is simplicity, second ones is flexibility. In second one you could remove and change z-pos etc. very easily inside a group, and you could maybe even use Group as a way to move things, as example DisplayGroup(ID, x, y)


This would be great thing to have, would make life so much easier.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GroupLayer / UnGroupLayer

Post by airsoftsoftwair »

This has been on my to do list for a long long time and it was planned for Hollywood 4.5 or so and there's even lots of code for it already in my layers library but it is all disabled because it turned out to be too difficult to implement in the end. There are lots of things to consider here, i.e. transformation of a layer group, showing/hiding a layer group with transition effects, grouping different types of layers in a single group, e.g. a video layer and a brush layer and an animation layer. It's horribly complex. Don't expect this to ever make it into Hollywood.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GroupLayer / UnGroupLayer

Post by airsoftsoftwair »

Well, never say never:

Code: Select all

- New: Added GroupLayer() and UngroupLayer() to organize layers in groups and access them via a group id;
  this is a feature that was originally planned for Hollywood 4.5 and code was written back then but it was
  never completed; remnants of the code, however, have been in Hollywood from as early as version 4.5,
  e.g. the #ATTRGROUP attribute for #LAYER, the "Group" tag set by GetLayerStyle() and error codes like
  #ERR_GROUPNAMEUSED; after more than 10 years, layer grouping has finally been implemented properly; the
  following functions can be used with layer groups now: ShowLayer(), HideLayer(), RemoveLayer(), 
  ShowLayerFX(), HideLayerFX(), RemoveLayerFX(), MoveLayer(), RotateLayer(), ScaleLayer(), LayerToFront(),
  LayerToBack(), SetLayerAnchor(), SetLayerBorder(), SetLayerFilter(), SetLayerShadow(), SetLayerStyle(),
  SetLayerTint(), SetLayerTransparency(), TransformLayer() and TranslateLayer(); additionally, all drawing
  functions accept a new "Group" tag now that allows you to attach the layer to a group at creation time;
  the #ATTRGROUP attribute allows you to find out which group a layer is attached to; finally, there are
  some additional functions to deal with layer groups, namely GetLayerGroups(), GetLayerGroupMembers() and
  IsLayerGroup(); note that layer groups will automatically vanish as soon as no more layers are attached
  to them
Post Reply