Hi folks,
Do you know that feeling, when you've been trying to implement a feature for a long time but you couldn't for a varierty of reasons (complexity, cross platform issues, lack of lower level API, etc), and then you suddenly realise, years later, that you can now do it ?
Well that's what happened a few weeks ago, when I realized that nowadays all platforms Gideros target are supporting C++11. And with C++11 comes a lovely feature: Lambda-expressions. Of course we knew them already in lua (they are closures), but they are relatively new in the C++ world. And thanks to those lambda, writing continuation functions for multithread/deferred/async processing is much much easier.
So that's it, a long awaited feature is finally availble in Gideros 2021.9: the ability to
asynchronously load textures. Internally Gideros will do all the heavy stuff in a side thread, not blocking the main rendering thread, and trigger a callback when the Texture is ready to be used. This allows smoother animated loading screens.
Another great thing available in this new version: multi font and even images in TextField.
This was made possible by three changes:
- a new TexturePackFont object that allows to turn a TexturePack into a font, usable by TextField
- a change in CompositeFont, that allows individual fonts to be named
- a new escape code in TextField: "\e[font=name]" that allows you to select which font to use for a chunk of text inside a TextField, if a CompositeFont is used.
You can then build a CompositeFont with several fonts (normal, bold, fancy, texturepackfont) and render all of them in a single TextField. Associated with Gideros powerful text layout options this ease things a lot!
Full list of changes:
New features[core] Add Texture.loadAsync() call
[core] Add TexturePack.loadAsync() call
[core/font] Allow multiple fonts in a single TextField
[core/font] Allow to turn TexturePacks into Fonts
Improvements[core] Support grayscale render targets
[core] Add TexturePack:getRegionsNames()
[tools] Associate .tproj and .GApp extensions so that they open the required tool
[plugin/camera] Add a setOrientation() Call (iOS, Android)
[plugin/share] Allow setting of photo library usage (iOS)
[plugin/virtualtntpad] Update
[export/html] Update to latest emscripten (2.0.27)
[export/html] Support APPLICATION_SUSPEND/APPLICATION_RESUME
Fixes[core] Fix rendering 3D in render target
[player] Allow setting FPS from lua
[player] Fix Open project and Restart project menu actions
Download it from here:
http://giderosmobile.com/downloadDon't hesitate to donate while downloading to support Gideros, or anytime using the 'DONATE' link at the top of the forum page.
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Bump's
First, without filter function player just crushes. Second, this function return another function and a number, but should be table and table len.
Ive added
So, I kinda fixed "project" function, and now it works.
But there is a problem.
The implementation is very simple. Response struct:
LUA function
Now the problem is that your response function must look like that:
Likes: MoKaLux
https://github.com/MultiPain/gideros/commit/8134e44eaf16078a9c0dcb2bedcc8c977ad12e6f
at least i guess timer:stop() resets the timer so that when it is again started it will wait delay time before it triggers the callback. while if we pause it then it should not reset the timer and if we are halfway between two triggers then after resuming it should only wait half the time until the next trigger.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh, E1e5en
Likes: E1e5en
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://github.com/gideros/gideros/blob/f72e93ea3bb6420106d63e8167bd20a6a7dbb0bf/2dsg/gfxbackends/gl2/gl2ShaderBuffer.cpp#L190
I guess should not be a problem?
https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format
https://developer.apple.com/documentation/metal/mtlpixelformat
the issue: usually pen button behaves like right-click and that's what i'd want too. but there is a problem. basically there are two ways the tablet can work, which can be set in the wacom driver app:
1. 'use windows ink' - in this case i have pressure sensitivity but both pen buttons register as a left-click, not good
2. do not 'use windows ink' - in this case pen button is registered as a right-click, yet pressure sensitivity info is lost, the event when i draw with the pen is registered by gideros as a regular mouse event, not good
so in both versions something is not working. is it possible to correct that?
thanks a lot
btw @rrraptor , in any of the above cases imgui does not seem toget pen pressure info (in the demo window input part)
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
CASE 1 - use windows ink DISABLED:
pen touches tablet:
{__target = {__events = {}, __userdata = "userdata: 031E0308"}, __uniqueid = 311, __userdata = "userdata: 031E347C", allTouches = {{id = 1, modifiers = 0, mouseButton = 1, pressure = 0, rx = 451, ry = 199, type = "mouse", x = 451, y = 199}}, touch = nil, touches = {nil}, type = "touchesBegin"}
pen button pressed:
{__target = {__events = {}, __userdata = "userdata: 031E0308"}, __uniqueid = 2336, __userdata = "userdata: 031E347C", allTouches = {{id = 1, modifiers = 0, mouseButton = 2, pressure = 0, rx = 528, ry = 241, type = "mouse", x = 528, y = 241}}, touch = nil, touches = {nil}, type = "touchesBegin"}
CASE 2 - use windows ink ENABLED:
pen touches tablet:
{__target = {__events = {}, __userdata = "userdata: 0329A308"}, __uniqueid = 550, __userdata = "userdata: 0329D47C", allTouches = {{id = 1, modifiers = 0, mouseButton = 0, pressure = 0.2626953125, rx = 494, ry = 245, type = "penTablet", x = 494, y = 245}}, touch = nil, touches = {nil}, type = "touchesBegin"}
{__target = {__events = {}, __userdata = "userdata: 0329A308"}, __uniqueid = 1734, __userdata = "userdata: 0329D47C", allTouches = {{id = 1, modifiers = 0, mouseButton = 1, pressure = 0, rx = 494, ry = 245, type = "mouse", x = 494, y = 245}}, touch = nil, touches = {nil}, type = "touchesBegin"}
pen button pressed:
{__target = {__events = {}, __userdata = "userdata: 017DD308"}, __uniqueid = 225, __userdata = "userdata: 017E047C", allTouches = {{id = 1, modifiers = 0, mouseButton = 0, pressure = 0, rx = 429, ry = 312, type = "penTablet", x = 429, y = 312}}, touch = nil, touches = {nil}, type = "touchesBegin"}
{__target = {__events = {}, __userdata = "userdata: 017DD308"}, __uniqueid = 228, __userdata = "userdata: 017E047C", allTouches = {{id = 1, modifiers = 0, mouseButton = 1, pressure = 0, rx = 429, ry = 312, type = "mouse", x = 429, y = 312}}, touch = nil, touches = {nil}, type = "touchesBegin"}
i hope this helps.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
So what you need is that the mouseButton field of the pen event have a correct value, not 0, right ?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I can implement the same trick in gideros
the right-click issue seems independent though, right?
Fragmenter - animated loop machine and IKONOMIKON - the memory game