MacOSX Desktop
I need for window to expand (transition) to larger window or shrink to smaller window depending on user action.
I need to do this in code. is that possible?
MacOSX Desktop
I need for window to expand (transition) to larger window or shrink to smaller window depending on user action.
I need to do this in code. is that possible?
I’m unaware of a way to change the window size without allowing the user to resize the window on their own.
Rob
love version of Lua has a window class that can do this love.window.setMode, can anyone think of a way to do this in corona or pure Lua?
To be clear, that is a feature of LOVE, not Lua. Lua is simply the scripting language that one uses in LOVE and Corona to access the features of the respective game SDKs.
I’m saying this because, the Corona Framework does not support this, so no Lua trick in the world will make it work.
The good news is, you can submit a feature request: http://feedback.coronalabs.com/forums/188732-corona-feature-requests-feedback
Thanks Ed,
I was hoping there was some “secret sause” in Lua I could get to…
I will put the request in.
Roger
When you do, please post a link to it here. I’ll vote for it. I too have wanted this in the past.
Not sure how to link the request but its listed in feature request as :
ability Change Window Parameters, Size, Position etc… in code
Hi.
It might be possible to do this with a plugin I’ve been taking my sweet time submitting: luaffifb
This provides a “foreign function interface” (FFI): it lets you import public functions from dynamic libraries into Lua, from Lua. (Desktop-only at the moment, alas; I have a seemingly functional Windows port.) The steps you seem to need look like they might be exposed in luapower’s objc library. (Likewise Windows.) I don’t know the API much at all, but I imagine you have to discover the current window somehow and then go to town.
If you’re brave you could give it a shot, with my most recent binaries. Drop the appropriate one on your platform in the folder indicated by the following:
print(system.pathForFile("plugin", system.PluginsDirectory))
and then do
local ffi = require("plugin.ffi")
The FFI basically adheres to the LuaJIT documentation, subject to the provisos mentioned in the plugin page above, though digging into the luapower examples might be informative as well.
(As I’ve mentioned elsewhere in the past, the big holdup submission-wise has been the need to sit down and try out various FFI modules to see if luaffifb is adequate, rather than needing LuaJIT proper. I assume it had to meet a high bar for Facebook to use it with Torch, but it won’t hurt to check. That will probably tease out some decent samples, at any rate. I’d gladly include a working window resize example. :) Or any other contributions, of course.)
Of course, I offer the above as an alternative to using native code directly, which is another choice.
Can you please post example (for Mac)
Unfortunately, as I said, I don’t have a ready-made example, though there are plenty of FFI snippets for other things in those links and elsewhere. I only brought it up on the off chance somebody might run with it.
That said, some windowing stuff is a decent idea for a sample to include whenever I do find a chance to work on the plugin again.
I’m unaware of a way to change the window size without allowing the user to resize the window on their own.
Rob
love version of Lua has a window class that can do this love.window.setMode, can anyone think of a way to do this in corona or pure Lua?
To be clear, that is a feature of LOVE, not Lua. Lua is simply the scripting language that one uses in LOVE and Corona to access the features of the respective game SDKs.
I’m saying this because, the Corona Framework does not support this, so no Lua trick in the world will make it work.
The good news is, you can submit a feature request: http://feedback.coronalabs.com/forums/188732-corona-feature-requests-feedback
Thanks Ed,
I was hoping there was some “secret sause” in Lua I could get to…
I will put the request in.
Roger
When you do, please post a link to it here. I’ll vote for it. I too have wanted this in the past.
Not sure how to link the request but its listed in feature request as :
ability Change Window Parameters, Size, Position etc… in code
Hi.
It might be possible to do this with a plugin I’ve been taking my sweet time submitting: luaffifb
This provides a “foreign function interface” (FFI): it lets you import public functions from dynamic libraries into Lua, from Lua. (Desktop-only at the moment, alas; I have a seemingly functional Windows port.) The steps you seem to need look like they might be exposed in luapower’s objc library. (Likewise Windows.) I don’t know the API much at all, but I imagine you have to discover the current window somehow and then go to town.
If you’re brave you could give it a shot, with my most recent binaries. Drop the appropriate one on your platform in the folder indicated by the following:
print(system.pathForFile("plugin", system.PluginsDirectory))
and then do
local ffi = require("plugin.ffi")
The FFI basically adheres to the LuaJIT documentation, subject to the provisos mentioned in the plugin page above, though digging into the luapower examples might be informative as well.
(As I’ve mentioned elsewhere in the past, the big holdup submission-wise has been the need to sit down and try out various FFI modules to see if luaffifb is adequate, rather than needing LuaJIT proper. I assume it had to meet a high bar for Facebook to use it with Torch, but it won’t hurt to check. That will probably tease out some decent samples, at any rate. I’d gladly include a working window resize example. :) Or any other contributions, of course.)
Of course, I offer the above as an alternative to using native code directly, which is another choice.
Can you please post example (for Mac)