# Different animations for materialUI RoundedRectButtons

**URL:** <https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522>\
**Category:** Marketplace Assets\
**Created:** [June 27, 2017, 2:22am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522 "2017-06-27T02:22:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![silassales](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@silassales](https://forums.solar2d.com/u/silassales)\
**Post date:** [June 27, 2017, 2:22am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/1 "2017-06-27T02:22:48Z")

</div>

Hey guys,&nbsp;

So I am using materialUI to create some simple interfaces, I have a back button currently that I want to go back to my menu scene.

Right now I am using this code to create the button to go back to the menu:

```
mui.newRoundedRectButton ({ name = "back\_nav\_button", text = "nothing", width = mui.getScaleVal(80), height = mui.getScaleVal(80), textColor = { 0,0,0,0 }, radius = 10, callBack = mui.actionSwitchScene, callBackData = { sceneDestination = "title", sceneTransitionColor = { .5,.5,.5 }, sceneTransitionAnimation = true }, image = { src = "images/back-icon-sheet.png", sheetIndex = 1, touchIndex = 2, touchFadeAnimation = true, touchFadeAnimationSpeedOut = 500, sheetOptions = { width = 101, height = 101, numFrames = 2 } } })

```

I was wondering if there was a was to have a different animation than the current one which is a bubble transition, ideally a way to have the scene transition like it does natively with composer.goToScene().

I tried using callBack = composer.goToScene( “menu” ), but that call is placed as soon as this current scene is created, not after the back button is pressed.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![silassales](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@silassales](https://forums.solar2d.com/u/silassales)\
**Post date:** [June 30, 2017, 1:24am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/2 "2017-06-30T01:24:46Z")

</div>

For anyone who is looking at this in the future,

I made a real rookie mistake…

When using mui, and callbacks, just dont include the function brackets, and then within a local function you can goToScene to natively transition between scenes.&nbsp;

```
--so like mui.someThing ({ callback = myTransitionFunc }) --not mui.someThings ({ callback = myTransitionFunc() })

```

which as I look at it now, is very obvious

---

<div class="post-metadata">

**Author:** ![anon63346430](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/6a8cbe/32.png) [@anon63346430](https://forums.solar2d.com/u/anon63346430)\
**Post date:** [June 30, 2017, 1:32am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/3 "2017-06-30T01:32:33Z")

</div>

Your code is identical in lua and is not your issue…

```
local function blah()

```

is exactly the same as

```
local blah = function()
```

---

<div class="post-metadata">

**Author:** ![silassales](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@silassales](https://forums.solar2d.com/u/silassales)\
**Post date:** [June 30, 2017, 1:40am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/4 "2017-06-30T01:40:14Z")

</div>

> [@anon63346430](#):
>
> Your code is identical in lua and is not your issue…
> 
> ```
> local function blah()
> 
> ```
> 
> is exactly the same as
> 
> ```
> local blah = function()
> 
> ```

Ya my bad, edited it now, thanks for the save

---

<div class="post-metadata">

**Author:** ![silassales](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@silassales](https://forums.solar2d.com/u/silassales)\
**Post date:** [June 30, 2017, 1:24am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/5 "2017-06-30T01:24:46Z")

</div>

For anyone who is looking at this in the future,

I made a real rookie mistake…

When using mui, and callbacks, just dont include the function brackets, and then within a local function you can goToScene to natively transition between scenes.&nbsp;

```
--so like mui.someThing ({ callback = myTransitionFunc }) --not mui.someThings ({ callback = myTransitionFunc() })

```

which as I look at it now, is very obvious

---

<div class="post-metadata">

**Author:** ![anon63346430](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/6a8cbe/32.png) [@anon63346430](https://forums.solar2d.com/u/anon63346430)\
**Post date:** [June 30, 2017, 1:32am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/6 "2017-06-30T01:32:33Z")

</div>

Your code is identical in lua and is not your issue…

```
local function blah()

```

is exactly the same as

```
local blah = function()
```

---

<div class="post-metadata">

**Author:** ![silassales](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@silassales](https://forums.solar2d.com/u/silassales)\
**Post date:** [June 30, 2017, 1:40am UTC](https://forums.solar2d.com/t/different-animations-for-materialui-roundedrectbuttons/344522/7 "2017-06-30T01:40:14Z")

</div>

> [@anon63346430](#):
>
> Your code is identical in lua and is not your issue…
> 
> ```
> local function blah()
> 
> ```
> 
> is exactly the same as
> 
> ```
> local blah = function()
> 
> ```

Ya my bad, edited it now, thanks for the save
