Hi guys,
Lately i tried things with Windows Desktop Export, and realized that it can have so many API.
I tried to minimize the API so it won't bother other device when updating it, and here is what i get:
application:set(what,...)
application:get(what)
--------------------------------------------------------------------
You can print all available API by doing :
application:set("help")
application:get("help")
This is also applied on type of each API, for example :
application:set("cursor","help")
--------------------------------------------------------------------
Currently available API :
- application:set("cursor",type)
arrow
upArrow
cross
wait
IBeam
sizeVer
sizeHor
sizeBDiag
sizeFDiag
sizeAll
blank
splitV
splitH
pointingHand
forbidden
openHand
closedHand
whatsThis
busy
dragMove
dragCopy
dragLink
- application:set("windowModel",type)
reset
stayOnTop --- can stack with other
stayOnBottom --- can stack with other
frameless --- can stack with other
noTitleBar
noWindowButton
onlyMinimize
onlyMaximize
onlyClose
noMinimize
noMaximize
noClose
helpButton
Stack example :
application:set("windowModel","closeOnly")
application:set("windowModel","stayOnTop")
- application:set("windowTitle",title)
- application:set("windowPosition",x,y)
- application:set("windowSize",w,h)
- application:set("minimumSize",w,h) -- for scaling
- application:set("maximumSize",w,h) -- for scaling
- application:set("windowColor",red,green,blue)
- application:set("cursorPosition",x,y)
--------------------------------------
- application:get("windowPosition") return x,y of window
- application:get("screenSize") return screen size w,h
- application:get("windowSize") return window size w,h
- application:get("cursorPosition") return window size x,y
--------------------------------------
As i mainly operate on Windows, i would not build Mac OSX for testing.
Also, feel free to request any new things regarding Desktop. \:D/
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
--- Also for just testing purpose, probably would add later on as real event ---
Make sure at Project Properties, you don't tick "Touch events generate mouse events" for this test.
Likes: pie
so please implement it so that it's received on say event.touch.pressure.
and will the same work on mac? i don't have any to test but my friends would use it on mac too, so it would be good to have it.
last, it would be nice if pressure on android would use the same api and i would not need to use plugin anymore and also it would work across platforms.
in android it's a very simple thing, event.getPressure() can get pressure info called inside onTouch function, see my plugin doing this here:
http://giderosmobile.com/forum/discussion/1557/get-stylus-pressure-information/p1
but it's basically this one line and the rest is additional work so that it works as a plugin.
again: thanks a lot, this is awesome, this progress is way beyond my expectations.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
But the event itself is global, i will try to manage it more as a real event and try to ask a pull request
[3] removed tablet from touches, and added as real event.
Now the app can receive :
If you activated encryption for export, you need to copy it to template folder, and do non-asset only export.
It will take some time to add it to pull request, so i don't think i will do it this week, since i need to prepare for my game.
@keszegh Did your wacom have tilt, can you test it for me?
with this version i got errors, running your example (or anything else) in player it's:
main.lua:2: unexpected symbol near '�'
while win export error is:
memory allocation error: block too big
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Anyway, i tried to change things, probably works, probably not.
@keszegh Can you try it again?
let me know how can i test tilt.
also i would be grateful if at some point the same would work for mac export too.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
pressure, x, y, tiltX, tiltY, pointerType (can indicate whether it is pen or eraser), tangentialPressure (this is rare i think, only for airbrush type)
Actually there is still z & rotation, but i don't think i it is needed, so i removed them.
I believe it would work on Mac, because this is native in the Qt engine.
For Android/iOS, i think it would be "event.touch.pressure", because when i read about touch event, actually there is data to know whether it is finger or pen (different from this pentablet).
pressure, x, y, tiltX, tiltY, pointerType
tangentialPressure is always zero but i don't have an airbrush pen for my tablet, so i tested only with my normal wacom pen.
why don't you add z and rotation if it's there anyway?
so far so (very) good.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
There is also "device", which will indicate what kind of device that send the input.
http://doc.qt.io/qt-4.8/qtabletevent.html
There are actually 2 more event, enter_proximity and leave_proximity, which i still don't know how to handle them. Those events are the one who usually handle z.
It's incomplete for those, but complete for just penTablet.
So yeah, let's just leave it at that... \m/ \m/
Regarding the virus...
Well, i'm not sure whether it is false alarm or not, but my PC have no problem so far. :-?
To avoid it, you can add the exception at the antivirus.
enter and leave proximity could be another event, then hovering could be noticed by the app, but that's also not crucial.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
people feel free to agree/disagree
instead of setDesktopProperty/getDesktopProperty let's make it simply set/get methods
so the values could also be tweened if needed.
also there might be some mobile or platform specific properties we can make changeable. So in docs we could list what platforms support what properties.
Let's make property name camelCase and let's not create property constants, as it will pollute the scope, but simply use string directly (as with Sprite:set/get methods)
Also in that case, if you set/get value that is not for these platform, it should ignore/return nil, but not crash
About Touches, let's make additional property pressure which returns pressure if such is available and 0 if not.
It might be hard to add new property for touch because of the need to go through many internals, so I can change the core and you can simply add pressure for platforms you can
makes sense?
Likes: keszegh, pie
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Great, i also love that idea.
This make our job to add API so much easier. \m/
(I think i will also try to give print of available method & value when it doesn't fit, that way people won't need to look at API too much)
Well, for PenTablet, i already experienced going through many internals, and it is indeed tiring. I guess i probably can manage to add pressure for touches event. \:D/
Likes: ar2rsawseen
I taken down the pen tablet pull request.
After second thought, it might have a little impact for performance, so better not use it as standard one.
I would try to create plugin for it.
That's why I wanted to put it to touch events, so we could use it on other platforms too
But that's totally up to you.
Either way it is better to take things step by step, yes
@ar2rsawseen, @tkhnoman, as a compromise isn't it possible to have something like an application:registerPressure(true)
which would turn on pressure registering in which case event.touch.pressure has the pressure info (both on android and on desktop) while if it's
application:registerPressure(false) , which could be the standard behaviour if there is that impact on performance, no pressure would be handled and event.touch.pressure could simply return nil.
what do you think about this?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://giderosmobile.com/forum/discussion/comment/43271#Comment_43271
https://deluxepixel.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Before people got weirder tought about this. Pen tablet and touch is two different device. They do both have pressure, but pen tablet won't create pressure on touch and vice versa.
It's like that there is button on keyboard and controller, but they are different.
As for the performance, it did drop but very very little and untoticable, like that if you use multiplier instead of divider, so i decide not to.
I can manipulate pen tablet pressure to enter touch pressure, but let's try for plug in first, because there is stil tilt and other components for pen tablet.
I think let's settle with this, since creating plugin is kind of hard to do. This also won't affect performance at all.
It detect pen tablet event, but called touch event for it.
But be aware, since pen tablet is considered mouse at Desktop, it would also generate addition touch event if "Mouse Events generate touch events" on project properties ticked.
Luckily, it still possible for user to deal with it, because now touchEvent would also produce type. It would generate "mouse" on generated-touch-event from mouse.
pen and penTablet are different device. Haven't test whether that pen device would generate penTablet or not, because i don't have touch device that can be switched to pen.
Once @SinisterSoft finished checking whether it works or not, i would ask for pull request for this, but would only work for Desktop.
All pressure would be 0 and all type would be "finger" on another platform, because i won't develop on them.
So I can't test out right now, but I will before tomorrow. I'll test it on Windows 8.1 (what it arrives with) and also on Windows 10 (what I'll be updating it to asap).
https://deluxepixel.com