Skip to main content
JHarding
Senior
May 8, 2020
Question

Is there a way to cast a container to a MoveAnimator< Container >

  • May 8, 2020
  • 2 replies
  • 601 views

The title says it all. I need to cast a straight container to a MoveAnimator< Container >

I have a function in a base class that extends the container class like so:

hideMenu(MoveAnimator< touchgfx::Container >& menu)

Inside this base class I obviously cannot call MoveAnimator functions, so I would like to cast "this" to a move animator so the base class itself can call its own move animation functions.

This topic has been closed for replies.

2 replies

Martin KJELDSEN
Principal III
May 12, 2020

A more simple approach would maybe be to have a "base" class which is not really a base class but a class that holds a MoveAnimator it can call functions on. Unless you need a baseclass that can, at run-time, cast to any kind of animator (Fade, Move, etc).

/Martin

JHarding
JHardingAuthor
Senior
May 20, 2020

Well, I have a base class that is extended to many other object types. I want to cast the extended classes as move animators to the base class type as a move animator so that the base class functions can operate on the extended classes.