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

**URL:** <https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [January 30, 2025, 3:32pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621 "2025-01-30T15:32:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [January 30, 2025, 3:32pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/1 "2025-01-30T15:32:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 30, 2025, 4:29pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/2 "2025-01-30T16:29:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [January 30, 2025, 4:55pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/3 "2025-01-30T16:55:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [January 31, 2025, 11:09pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/4 "2025-01-31T23:09:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 1, 2025, 12:12am UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/5 "2025-02-01T00:12:26Z")

</div>

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_ @paul-griffith into doing it.

/me runs away 🤣

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [February 1, 2025, 1:26am UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/6 "2025-02-01T01:26:11Z")

</div>

> /me runs away 🤣

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

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 1, 2025, 1:28am UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/7 "2025-02-01T01:28:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 1, 2025, 4:13am UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/8 "2025-02-01T04:13:19Z")

</div>

> [@Dustin\_VanKeuren](#):
>
> the IRC chat days!

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).

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [February 2, 2025, 9:39pm UTC](https://forum.inductiveautomation.com/t/positioning-child-components-in-template-via-scripting-relative-to-template-position-on-screen/101621/9 "2025-02-02T21:39:10Z")

</div>

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.
