Positioning child components in template via scripting relative to template position on screen

I am creating a component that has moving parts that requires access to the template's position on the screen. At least I think I need to be able to reference the template position. What I really would like is to be able to use 0,0 for the internals and still have the internal moving parts work properly and animate relative to the templates position when dropped into a screen.

I am essentially moving a rectangle around inside the template using a calculation based on a production number and obviously need the parts to stay together if the template moves. I am not sure exactly how to go about this.

I hope this makes sense, I am a bit tired.

Edit: I think I am going to use the drawable canvas for this. Might as well tinker with it.

Consider adding a container inside the template to hold all of the pieces, then just move the container. (Using system.gui.transform())

Not sure that will work, or I am thinking along the wrong path. We are trying to show the blades of a rotary shear as they move along their path. We got it to work on a screen, just trying to make it a component so it can be tossed in the toolbox as it were.

I suppose this is one of those instances where the paintable canvas would be handy. I just wish that it had a design time image.

1 Like

Heh. You aren't the only one to think so. I've been tempted to make a new version that does, but keep thinking it would be more efficient to convince nerd snipe @PGriffith into doing it.

/me runs away :rofl:

3 Likes

/me runs away :rofl:

Ah, I see you too have survived the IRC chat days!

Phil has survived the meteor that brought about the ice age. That's easy to do though if you're made from divine matter :person_shrugging:

Nah, never a fan of that new-fangled instant contact stuff. I prefer non-html email above all. From the bitnet days at uni (pre-internet).

Ah, I see. The notation was used commonly on IRC. I still use it when chatting. Much to my embarrassment I spent way too much time chatting on IRC back in the day.

1 Like