dmccuskey / dmc-corona-library Goto Github PK
View Code? Open in Web Editor NEWDevelopment library for Corona SDK
Home Page: docs.davidmccuskey.com/
Development library for Corona SDK
Home Page: docs.davidmccuskey.com/
Using dmc_buttons radio group.
Problem: Initial state of the button's active/inactive modes are not set. In my case the button's active image is showing underneath the inactive image since they are of different sizes.
Details:
img_data.active.isVisible = false is not being called in BinaryButton:_initComplete() since BinaryButton has __isIntermediate set on the object for being a child class of ButtonBase.
Hi @dmccuskey,
Thanks a lot for this library! It would be great to have a CoronaSDK plugin of it available here: https://store.coronalabs.com/plugins
Cheers!
tcp-nodelay, keepalive, etc
readme in homepage and examples
@ docs.davidmccuskey.com
write new documentation for dmc_touch @ docs.davidmccuskey.com
Hello David,
First off, I love your dmc_touchmanager.lua library. It saved my butt. I have a feature request that would be an awesome addition to your library. It's easiest to explain it with a short example:
Pretend that I'm working on a virtual tape recorder. I have Play, Stop, and Record buttons, each with a touch event. I'm using multitouch in my application, so technically it is possible to press any of these three buttons simultaneously. When that happens, the three touch-handling functions run at the same time with potentially unpredictable results.
It would be great to be able to say, "While the Play button is touched, the Stop button should not respond to a touch".
Thanks!
Hello,
The websocket example works on Corona simulator, but as soon as I upload it onto my iphone6, I have the following error in logs :
Oct 3 01:37:05 iPhone-de-olivier dmc-websockets-echo[2496] <Warning>: Platform: iPhone / iPhone7,2 / 8.0.2 / Apple A8 GPU / OpenGL ES 2.0 Apple A8 GPU - 50.5.1 / 2014.2393
Oct 3 01:37:05 iPhone-de-olivier dmc-websockets-echo[2496] <Warning>:
##############################################
Oct 3 01:37:05 iPhone-de-olivier dmc-websockets-echo[2496] <Warning>: Lua Patch::activating patch 'table-pop'
Oct 3 01:37:05 iPhone-de-olivier dmc-websockets-echo[2496] <Warning>: Lua Patch::activating patch 'string-format'
Oct 3 01:37:05 iPhone-de-olivier dmc-websockets-echo[2496] <Warning>: Runtime error
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/dmc_corona/dmc_websockets.lua:136: module 'dmc_sockets' not found in archive:
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/
module 'dmc_sockets' not found:resource (dmc_sockets.lu) does not exist in archive
no field package.preload['dmc_sockets']
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.lua'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.lua'
no file './dmc_sockets.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.so'dmc_sockets
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/dmc_corona/dmc_sockets.lua:130: module 'dmc_sockets.async_tcp' not found in archive:
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/
module 'dmc_sockets.async_tcp' not found:resource (dmc_sockets.async_tcp.lu) does not exist in archive
no field package.preload['dmc_sockets.async_tcp']
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.async_tcp.lua'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.async_tcp.lua'
no file './dmc_sockets.async_tcp.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.async_tcp.so'
no file './dmc_sockets.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_sockets.so'dmc_sockets.async_tcp
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/dmc_corona/dmc_sockets/async_tcp.lua:53: module 'plugin.openssl' not found in archive:
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/
module 'plugin.openssl' not found:resource (plugin.openssl.lu) does not exist in archive
no field package.preload['plugin.openssl']
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/plugin.openssl.lua'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/plugin.openssl.lua'
no file './plugin.openssl.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/plugin.openssl.so'
no file './plugin.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/plugin.so'plugin.openssl
/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona
module 'dmc_corona.plugin.openssl' not found:resource (dmc_corona.plugin.openssl.lu) does not exist in archive
no field package.preload['dmc_corona.plugin.openssl']
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona.plugin.openssl.lua'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona.plugin.openssl.lua'
no file './dmc_corona.plugin.openssl.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona.plugin.openssl.so'
no file './dmc_corona.so'
no file '/private/var/mobile/Containers/Bundle/Application/8EF0CF7B-216B-4B74-8CD0-8DDB99966A7A/dmc-websockets-echo.app/dmc_corona.so'dmc_corona.plugin.openssl
stack traceback:
[C]: in function 'error'
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/dmc_corona_boot.lua:421: in function 'require'
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/dmc_corona/dmc_websockets.lua:136: in main chunk
[C]: in function 'require'
?: in function <?:803>
(tail call): ?
/Users/olivier/Downloads/DMC-Corona-Library-master/examples/dmc_websockets/dmc-websockets-echo/main.lua:18: in main chunk
I have this error as soon as I include the line in any project :
local WebSockets = require 'dmc_corona.dmc_websockets'
I have not tried on other iPhone/iPad model.
Thanks for any advice.
Hi,
I open an async socket and sends a HTTP request as soon the socket
has entered a CONNECTED state.
The problem: The socket closes abruptly as soon as I sends the HTTP
request though. The strange thing is that I can see (using a network
sniffer) that the HTTP response actually arrives to my machine. If I call
sock:reconnect() as soon as the socket closes I can actually read the
data I see with the network sniffer. AFAICS I should be able to read the
data in the socket buffer even though the socket has been closed?
Your example slightly simplified:
local Sockets = require "lib.dmc_corona.dmc_sockets"
local onConnect, dataCallback, newlineCallback
local host = "www.dn.se"
local port = 80
local sock
local function sendRequest()
local bytes, err
local req_t, req
local req_t = {
"GET / HTTP/1.1\r\n",
"Host: " .. host .. "\r\n",
--"User-Agent: DMC Sockets " .. Sockets.__version .. "\r\n",
"Connection: close" .. "\r\n",
"\r\n"
}
req = table.concat( req_t, "" )
bytes, err = sock:send( req )
end
newlineCallback = function( event )
print("== Newline Handler ==")
event = event or {}
if not event.data then
print( event.emsg )
else
print("Received Data:\n")
for i,v in ipairs( event.data ) do
print(i,v)
end
print("\n")
end
end
onConnect = function(event)
if event.status == sock.CONNECTED then
print("=== Connection Established ===")
sendRequest()
print("Reading Data\n\n")
sock:receiveUntilNewline( newlineCallback )
elseif event.status == sock.CLOSED then
print("=== Connection Closed ===\n\n")
else
print("=== Connection Error ===")
print( event.emsg )
end
end
print("Starting Connection")
sock = Sockets:create( Sockets.ATCP )
sock:connect( host, port, { onConnect=onConnect } )
The result I see in the console:
maj 21 08:13:26.135 Starting Connection
maj 21 08:13:26.171 === Connection Established ===
maj 21 08:13:26.171 Reading Data
maj 21 08:13:26.490 === Connection Closed ===
The result I see with a network sniffer:
192.168.001.008.63023-095.101.045.192.00080: GET / HTTP/1.1
Host: www.dn.se
Connection: close
095.101.045.192.00080-192.168.001.008.63023: HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
X-Frame-Options: SAMEORIGIN
Content-Length: 333001
Cache-Control: private, max-age=43
Date: Sat, 21 May 2016 18:13:20 GMT
Connection: close
Set-Cookie: weight=34; expires=Fri, 19-Aug-2016 18:13:20 GMT; path=/; domain=.dn.se
Expires: Tue, 01 January 2013 01:00:00 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="ctl00_HtmlElement" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">
<head id="ctl00_masterPageHeader"><meta name="ARTICLEFIRSTPUBLISHDATE" property="ARTICLEFIRSTPUBLISHDATE" content="" /><meta name="ARTICLEAUTHORS" property="ARTICLEAUTHORS" content="" /><meta name="CSPAGEURL" property="CSPAGEURL" content="dn.se" /><meta name="CSSEARCH" property="CSSEARCH" content="" /><meta name="CSPAGETYPE" property="CSPAGETYPE" content="Section+with+three+columns" /><meta name="CSPAGENAME" property="CSPAGENAME" content="home.page" /><meta name="CSLEVEL2" property="CSLEVEL2" content="&level-2=none" /><meta name="CSLEVEL1" property="CSLEVEL1" content="&level-1=home" /><meta name="ADSPAGETYPE" property="ADSPAGETYPE" content="Section with three columns" /><meta name="ADSLAYOUT" property="ADSLAYOUT" content="Ettan" /><meta
...
I'm most probably dazed and confused. Can you help?
Cheers
/Jocke
Hello,
I'm starting to use your nice library today, trying to have a better structure in my codes and I just ran in a little issue. It's not a really big deal but I was thinking, if you still work on improving the library, you may be interested...
The thing is when I have a class A inheriting from CoronaBase and a class B inheriting from A. I override the _undoInit(), _undoCreateView() or _undoInitComplete() methods on class A but not on B. But when I use the destroy method on an instance of the class B there is two call done to these methods instead of just one.
You can easily see the problem by just adding some print in the _undoInit() and the _undoCreateView() of your Shape exemple.
It's not a big deal I can avoid this by just adding the methods to the B class with just the call to the super class.
Well that's all, I tried to find where the problem could come from by looking to your code but didn't really had the time to investigate a lot.
Thanks a lot for your great library! Keep up the good work!
Greg
debug_active=true/false
create swipe() library function, including constraints, etc.
tag as 0.2.0
includes modifying config file for typed params
adding module-specific location param in config file
dmc_corona-2.x
When using a wss:// secure connection for either websocket or wamp connection, async_tcp.la:240 crashes with a nil pointer. Works fine with ws://.
Runtime error
/Users/n8/Development/Project_Name/dmc_corona/dmc_sockets/async_tcp.lua:523: /Users/n8/Development/Project_Name/dmc_corona/dmc_sockets/async_tcp.lua:240: attempt to call method 'setoption' (a nil value)
self._socket:setoption( 'keepalive', true )
self._socket:setoption( 'tcp-nodelay', true )
self._socket is valid at time of execution. build.settings is including the ssl plugin.
["plugin.openssl"] = { publisherId = "com.coronalabs", },
Why is this happening, is there a fix, or workaround?
create move() library function, including constraints, etc.
tag as 0.1.0
Seems the wss, ssl not woking ..
Hi David,
I am not sure if you are aware that the documentation has been offline for a while now. Do you have plans to bring it back up? If not, is there any chance you can include the documentation for the DMC lib in this git?
Thanks.
looks like this is available in Lua 5.2, but Corona is currently using 5.1.
plus need to update location of module in github.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.