Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Initial delay with storyboard.gotoScene() ?
Started by Dell Dec 02 2011 11:21 PM

- - - - -
122 replies to this topic
[TOPIC CONTROLS]
Page 3 of 5 1 2 3 4 5
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

leafcutter

[GLOBAL: userInfoPane.html]
leafcutter
  • Observer

  • 14 posts
  • Corona SDK

I think having the option to turn off the 'copy to jpg' of the old scene would be very useful. I think in some cases it simply isn't needed as performance won't be affected by transitioning all the objects in a scene. The fact that it is so slow and doesn't work properly if the screen is scaled make storyboard very frustrating to use at times!
uid: 102112 topic_id: 18556 reply_id: 88341


[TOPIC: post.html]
#52

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

Hey @Johantd04

I love what you did, but I'm hitting an error and instead of me hacking around it, maybe you can give your official update.

If it's the first invocation, then you get a crash because of this code:

    -- Get The previous scene name
    local lastSceneName = storyboard.getPrevious()
    pr("Last  Scene " .. lastSceneName)

lastSceneName is nil if you haven't been to a scene yet, i.e. you're in main.lua and you haven't called gotoScene().

I'm overriding this call in main, so all of my other files will inherit it.

Also where is "pr" defined. Is that a native short cut for "print"? Or do you have some other definition?

Thanks
Rob
uid: 19626 topic_id: 18556 reply_id: 88550


[TOPIC: post.html]
#53

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

That should say print.
uid: 42417 topic_id: 18556 reply_id: 88553


[TOPIC: post.html]
#54

Omnigeek Media

[GLOBAL: userInfoPane.html]
Omnigeek Media
  • Corona Geek

  • 2,975 posts
  • Corona SDK

I did elegantly **hack** the previous scene problems and it kind of works aa long as i'm going forward, when swipe to go back (so I'm transitioning from left to right) it gets funky in a hurry.

scene1 swipe Right to left to scene2, everything is okay.
scene2 swipe left to right and scene 2 doesn't make it all the way off the screen.
Scene1 swipe right to left to scene 2 and it transitions all the way to the other side

I'll try to shoot a video when I get a chance and put it somewhere to see.

But I'm too tired to try and figure out it.
uid: 19626 topic_id: 18556 reply_id: 88557


[TOPIC: post.html]
#55

Johantd04

[GLOBAL: userInfoPane.html]
Johantd04
  • Enthusiast

  • 62 posts
  • Corona SDK

Just comment out the pr call. It's my debug function that lists tables/arrays (if any).

Still alot of improvments to be done and if anyone wants to contribute we can put up a project for this.
uid: 106083 topic_id: 18556 reply_id: 88624


[TOPIC: post.html]
#56

Johantd04

[GLOBAL: userInfoPane.html]
Johantd04
  • Enthusiast

  • 62 posts
  • Corona SDK

Removed pr() and fixed getPrevious bug

-- Project: Storyboard GoTo
--
-- Version: 1.0
--
-- Author: Johan Johansson @ Baboons.se
--
-- Support: www.baboons.se
--
-- Copyright (C) Baboons. All Rights Reserved.
--

local storyboard = require "storyboard"

-- OnComplete Event
local function onComplete(view)
    if view.lastScene then
        view.lastScene:exitScene()
    end
	view.scene:enterScene()
end

-- Set helper
local function Set(list)
    local set = {}
    for _, l in ipairs(list) do set[l] = true end
    return set
end

-- Goto To Scene
local gotoScene = function ( sceneName, effect, effectTime)

    local loadedScenes = Set{unpack(storyboard.loadedSceneMods)}

    -- Get The previous scene name
    local lastSceneName = storyboard.getPrevious()

    -- Get the previous scne
    local lastScene = storyboard.getScene( lastSceneName ) or nil

    -- Get or Load New Scene
    local scene = storyboard.getScene( sceneName ) or require( sceneName )

    -- Create Scene if not loaded
    if loadedScenes[sceneName] == nil then
       scene.view = display.newGroup()
       storyboard.scenes[sceneName] = scene
       table.insert(storyboard.loadedSceneMods, sceneName)

       scene:createScene()
    end

    -- Create View Group
    scene.view.scene = scene
    scene.view.lastScene = lastScene

    -- Set positions
    local newX = 0
    local newY = 0
    local curX = 0
    local curY = 0

    if     effect == "fromRight" then
        newX =  -display.contentWidth
    elseif effect == "fromLeft" then
        newX =  display.contentWidth
    elseif effect == "fromTop" then
        newY =  -display.contentHeight
    elseif effect == "fromBottom" then
        newY =  display.contentHeight
    elseif effect == "toBottom" then
        curY = display.contentHeight
    elseif effect == "toTop" then
        curY = -display.contentHeight
    elseif effect == "slideLeft" then
        newX = display.contentWidth
        curX = -display.contentWidth
    elseif effect == "slideRight" then
        newX = -display.contentWidth
        curX = display.contentWidth
    end

    -- Move New Scene View out of screen
    scene.view.x = newX
    scene.view.y = newY

    -- Move New Scene
    transition.to( scene.view, { time=effectTime,  x=(0), y=(0), onComplete=onComplete } )

    -- Move Current Scene
    if lastScene then
        transition.to( lastScene.view, { time=effectTime,  x=(curX), y=(curY) } )
    end
end

return gotoScene
uid: 106083 topic_id: 18556 reply_id: 88676


[TOPIC: post.html]
#57

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

I'm crunching on some other items at the moment but perhaps to save me some time - does this fix work? It gets rid of all delays between storyboard transitions?
uid: 42417 topic_id: 18556 reply_id: 88679


[TOPIC: post.html]
#58

Johantd04

[GLOBAL: userInfoPane.html]
Johantd04
  • Enthusiast

  • 62 posts
  • Corona SDK

It's experimental but it did remove the inital delay tough i found the animation (at least in my app and device) to feel just a bit laggy.
uid: 106083 topic_id: 18556 reply_id: 88681


[TOPIC: post.html]
#59

leafcutter

[GLOBAL: userInfoPane.html]
leafcutter
  • Observer

  • 14 posts
  • Corona SDK

@Hive

Short answer: in certain cases this will speed up transitions. I am using something similar and it is quicker.

Longer answer:

My guess is that the delay in transitions are caused by:

1 creating the new scene
2 moving the new scene on screen
3 moving the old screen off screen

In all these cases if you have lots and lots of objects in your scene then any / all of these will be slow.

In order to get round 3 being a potential slowdown what you can do is take a screen shot of the screen and move that off screen (as 1 object) instead of moving the real scene (potentially lots of objects) so it should be quicker. However, it seems that taking the screen shot is in itself very slow.

What the the code above does is simply move the scene offscreen. Again my guess is that for not very complex scenes this will be quicker, for very complex scenes it might actually be slower and look worse.
uid: 102112 topic_id: 18556 reply_id: 88717


[TOPIC: post.html]
#60

Taruga

[GLOBAL: userInfoPane.html]
Taruga
  • Enthusiast

  • 61 posts
  • Corona SDK

When will we get a fix for this issue from Ansca ?

Performance on simulator is way faster than on device, I hate this storyboard gotoScene delay :(
uid: 10141 topic_id: 18556 reply_id: 89164


[TOPIC: post.html]
#61

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

Yes. I'd rather have the official fix from Ansca. Can we get word back from anyone with Ansca?
uid: 42417 topic_id: 18556 reply_id: 89165


[TOPIC: post.html]
#62

peach pellen

[GLOBAL: userInfoPane.html]
peach pellen
  • Corona Geek

  • 8,866 posts
  • Alumni

Will bring this up in our next meeting and see if we have any new info.
uid: 52491 topic_id: 18556 reply_id: 89230


[TOPIC: post.html]
#63

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

Thanks Peach! I've got a client project to be launched within a week and it leans heavily on story board so I'm getting nervous now lol.
uid: 42417 topic_id: 18556 reply_id: 89236


[TOPIC: post.html]
#64

taweesakh

[GLOBAL: userInfoPane.html]
taweesakh
  • Observer

  • 6 posts
  • Corona SDK

I'm waiting this fix too
uid: 39186 topic_id: 18556 reply_id: 89579


[TOPIC: post.html]
#65

Bladko

[GLOBAL: userInfoPane.html]
Bladko
  • Contributor

  • 342 posts
  • Enterprise

Peach, any news ? Any chance to get fix or workaround this month ?

Tom
uid: 111283 topic_id: 18556 reply_id: 90981


[TOPIC: post.html]
#66

optionniko

[GLOBAL: userInfoPane.html]
optionniko
  • Enthusiast

  • 46 posts
  • Corona SDK

Hey,

Our project is nearing completion, and we really hope this bug will be fixed soon otherwise we'll have to wait! :(

Please Peach, could you possibly give us some approx date when this bug will be fixed?

Thank you very much!
Nick
uid: 77183 topic_id: 18556 reply_id: 90996


[TOPIC: post.html]
#67

jeremybell

[GLOBAL: userInfoPane.html]
jeremybell
  • Observer

  • 29 posts
  • Corona SDK

Our deadline is also within this Month, so we're eagerly awaiting a fix.
uid: 35618 topic_id: 18556 reply_id: 91001


[TOPIC: post.html]
#68

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

Our deadline is this week (ideally). I'm crossing my fingers on even an update so I can decide to rebuild some parts if it's absolutely necessary.
uid: 42417 topic_id: 18556 reply_id: 91003


[TOPIC: post.html]
#69

Taruga

[GLOBAL: userInfoPane.html]
Taruga
  • Enthusiast

  • 61 posts
  • Corona SDK

Please, fix this delay !
uid: 10141 topic_id: 18556 reply_id: 91022


[TOPIC: post.html]
#70

Johantd04

[GLOBAL: userInfoPane.html]
Johantd04
  • Enthusiast

  • 62 posts
  • Corona SDK

My "fix" works perfect with the performance optimization made with 2012.759. No lagg or delay on my iPhone 4.
uid: 106083 topic_id: 18556 reply_id: 91576


[TOPIC: post.html]
#71

Bladko

[GLOBAL: userInfoPane.html]
Bladko
  • Contributor

  • 342 posts
  • Enterprise

Johantd04,

Could You please update Your workaround with fade and crossfade ?

Thanks in advance !
Tom
uid: 111283 topic_id: 18556 reply_id: 91580


[TOPIC: post.html]
#72

Hive

[GLOBAL: userInfoPane.html]
Hive
  • Enthusiast

  • 86 posts
  • Corona SDK

I second this re the fade and crossfade. fingers crossed.
uid: 42417 topic_id: 18556 reply_id: 91598


[TOPIC: post.html]
#73

optionniko

[GLOBAL: userInfoPane.html]
optionniko
  • Enthusiast

  • 46 posts
  • Corona SDK

Peach,any news about the bug fix??

Thanks!
Nick
uid: 77183 topic_id: 18556 reply_id: 92251


[TOPIC: post.html]
#74

peach pellen

[GLOBAL: userInfoPane.html]
peach pellen
  • Corona Geek

  • 8,866 posts
  • Alumni

No news yet, although I am not directly involved with this - at the moment we've been rushing to fix the sprite issues from build 759+ which a lot of people have encountered. (Fix for that is in the latest daily build.)
uid: 52491 topic_id: 18556 reply_id: 92330


[TOPIC: post.html]
#75

zanden

[GLOBAL: userInfoPane.html]
zanden
  • Observer

  • 7 posts
  • Corona SDK

At the risk of being accused of piling on, I would also like to see this issue fixed.
uid: 8159 topic_id: 18556 reply_id: 92610



[topic_controls]
Page 3 of 5 1 2 3 4 5
 
[/topic_controls]