livecode - using mergPop with fullscreenmode? - livecode

Anyone using mergPop with fullscreenmode?
With this: set the fullscreenmode of me to letterbox
the popover does not locate properly. When I try adding the rect of the button it seems to have no effect. Testing in simulator with iPad simulation.
MergPop works great without setting fullscreenmode but I need fullscreenmode.

Unfortunately there's no API in the externals SDK yet that allows the translation of LiveCode points to UIKit points if you use a fullscreenmode so it's not possible for externals to support these modes properly yet. If you can work out exactly how much of a letterbox you have with the given aspect ratio then you may be able to calculate an appropriate rect for the optional from rect parameter.

Related

mobile-detect pixel size device change

Can please somebody tell at what screen size will mobile-detect npm package report tablet, mobile. For example, if width is below 320px it's mobile. I cannot find this information.
Thank you
From mobile-detect's documentation, it looks like it is focused on device detection, so it allows you to target specific devices.
If you want to detect pixel width for styling purposes, then you can simply use CSS media queries.
If you need to do programmatic things as opposed to just styles, then you can use javascript's native window.innerWidth method, or use jQuery for window.width and window.resize methods (for screen rotation, etc).
Hope this helps.

monogame screen resolution is incorrect

Monogame, or XNA really, is reporting the wrong screen resolution on my Surface Pro 3.
Using GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width and Height returns dimensions of 800 x 600, which is incorrect. So, I cannot set up my game size correctly.
I've been using this code without problem on an Acer V5 and can set the game resolution to a size I expect. This is because the GraphicsAdapter reports the correct screen size.
Whether using it as is, or docking the tablet with an external monitor, returns exactly the same resolution. What error is causing this?
This used to be a bug in Monogame, and was fixed.
If you are not building from the latest source code, it is possible that you still have the bug in your monogame dll.
See:
https://github.com/danzel/MonoGame/commit/0c36642129d89a12b30bcfc7d13256739d5483af

Can I create a Calligraphy look with SVG?

is it possible to create a stroke with a dynamic width with SVG? I want to achieve a Calligraphy look like here, here or here.
Is this even possible? It seems customization of strokes in SVG is fairly limited. Even gradients in strokes seem to be non-trivial (see here).
There is a proposal to add into SVG standard a mechanism, that does exactly what you want:
http://www.w3.org/Graphics/SVG/WG/wiki/Proposals/Variable_width_stroke
http://lists.w3.org/Archives/Public/www-svg/2013May/0041.html
There's even an example implementation available here:
https://rawgit.com/birtles/curvy/master/index.html
It is, however, by no means official and we cannot be even sure it'll ever be.
Until then you'll need to stick to Bezier curves and object filling:
You can also use calligraphic fonts, for example - Tangerine available on Google CDN:
This approach requires less work since you don't need to draw everything from scratch, but then again, using third party fonts leaves you with little control over the final result.
You can't dynamically adjust the stroke of a path element. However you could draw a path, use a fill color on it instead of stroke, then double back upon the letters at a slight distance away from the original line.
Also, if you are using the SVG on the web then you can use css fonts on text elements. There are some pretty good cursive fonts that you can use for free... just check google web fonts.

Rotation for some elements

I am trying to do thing that is already done in default Android 2.3 camera application - rotation only for some elements (such as buttons) when changing orientation of the device.
For example, when I switch my phone to landscape orientation I don't need to change whole layout - I only need to rotate some UI elements.
Don't know about Camera application in Android 4, but in Android 2.2 it looks the same as I want.
Is it possible?
(and sorry for bad English, guys)
This is an old question but I've just stumbled across it by accident. In case anybody finds this and is stumped there are two easy solutions. Your elements support a 'rotate' attribute which can do most of the hard work for it (just set an angle), but beware this seems to change the canvas dimensions and can leave you with empty padding. There is also a Rotate Drawable which will help you rotate other drawables.

Not able to get stencil to work

Was trying to get Stencil to work in my app. I use Sprites to render content on to the Device. Content could be movies, pictures or text.
Can I set the stencil buffer using these Sprites, which can be used in later passes to stencil out other Sprites being rendered?
I'm even not able to stencil out any of the Sprites by setting StencilFunction = Compare.Never! Anything wrong that I might be doing?
I've already spent almost an entire day checking out posts related to Stencils in MDX, but just couldn't get it to work.
Bit more searching got me to a technique wherein we draw silhouette of the shapes to be added to the stencil buffer. Is this really required in my case? I just want to use the Sprites, and add them to stencil buffer to stencil out other Sprites.
EDIT: OK.. So I figured out how to get it done. Referred to this post - http://www.gamedev.net/community/forums/viewreply.asp?ID=1999276
But now the sprite is ignoring alpha values and rendering sprites opaque. Similar to the effect we get when alpha blending is set to false. Any ideas?
So, I finally figured it out. It's all related to Sprites and its Begin() method.
Sprite.Begin() will modify the RenderState and disable stencil. We can prevent it by setting SpriteFlags.DoNotModifyRenderState flag, but then the alpha blending is not supported when sprites are drawn.
What I did now was simply call Sprite.Begin() without SpriteFlags.DoNotModifyRenderState flag set. And before the call to Sprite.Draw(), enabled stencil on the device.

Resources