cancel
Showing results for 
Search instead for 
Did you mean: 

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

JHarding
Senior

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.

2 REPLIES 2
Martin KJELDSEN
Chief III

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
Senior

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.