Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Different animations for materialUI RoundedRectButtons
Started by silassales Jun 26 2017 06:22 PM

3 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

silassales

[GLOBAL: userInfoPane.html]
silassales
  • Observer

  • 27 posts
  • Corona SDK

Hey guys, 

 

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.



[TOPIC: post.html]
#2

silassales

[GLOBAL: userInfoPane.html]
silassales
  • Observer

  • 27 posts
  • Corona SDK

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. 


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

--not 

mui.someThings ({
    callback = myTransitionFunc()
})

which as I look at it now, is very obvious



[TOPIC: post.html]
#3

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,219 posts
  • Corona SDK

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

local function blah()

is exactly the same as

local blah = function()


[TOPIC: post.html]
#4

silassales

[GLOBAL: userInfoPane.html]
silassales
  • Observer

  • 27 posts
  • Corona SDK

 

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




[topic_controls]
[/topic_controls]