Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Feature Request

BriarfoxBriarfox Mod
edited February 2014 in Beta Posts: 1,542

@Simeon I've been playing around with pasteboard a lot and it's a very handy feature. In some of my projects, I switch to another app, copy text/image and switch back to Codea. I was wondering if it would be possible to have a Codea function that gets called when switching back to Codea from another app. This would be handy for pasteboard use as well as calling pause states in a game if the project is left.

Something like:

function onEnter() --Called when Codea is switched to from another app.
str = pasteboard.text
gamePaused = true
end

I've been using this bit of code to accomplish the above. This works because Codea stops drawing when the project is left.

-- in draw()
local t = tonumber(os.date("%S"))
            if t - LoopTime > 1 then
                --do something
            end
            LoopTime = t

Comments

  • Jmv38Jmv38 Mod
    Posts: 3,295

    nice trick.
    about your request: how would codea know the project to start? so you must have a project running. then, why not just use your trick? it is so simple.
    i would rather like an http-scheme to call codea, as they have in pyhton...

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @Jmv38 that's in the plans

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @Simeon x-callback-urls would be awesome. @Jmv38 the above function works, just thought a Codea function would be useful.

  • Posts: 2,820

    @Simeon - Cool. :) If you're using the runtime (@Briarfox), it's super easy (IDK about the x-callback-urls part).

Sign In or Register to comment.