problem with setInteractive function in phaser 3 - phaser-framework

I have recently started using version 3.18 for a game which was earlier developed in version 3.9. Also, I am using Phaser.SCALE.FIT in config.
But on clicking or touching(in case of mobile) on some button images on the canvas nothing happens. I am using gameObject.setInteractive() and then gameObject.on(‘pointerdown’, function(){}) but the pointer down is not detected.
But if the size of the browser window changes somehow in between the game then the click is detected and everything else works fine.
How can I fix this issue any suggestion will be great help.

I don’t know the exact problem but when I used scene.scale.setGameSize(width, height) (https://rexrainbow.github.io/phaser3-rex-notes/docs/site/scalemanager/#events) in the create() the game starts working properly.

Related

Having issues with wxPython (Pheonix) sizes

I am trying to port over a bit of code from wx2.8 to wxPheonix (3.0.3.dev78356 msw). I'm using code from the pyfa project (https://github.com/DarkFenX/Pyfa) which is currently being rewritten for python3. This code takes some concepts from PyCollapsiblePane and implements it better (there are some bugs with PCP). If you download and open pyfa, the collapsible panels are on the right side (resources, resistances, etc) if you want to get a feel for how it is supposed to work.
Anyway, I'm trying to port this over and I cannot seem to get it to work well. I know Pheonix introduces some changes to sizers and how things are resized. I am able to collapse the panel (and have the parent panel fit to the new size), and then open it again. But when I try to collapse it again nothing seems to happen.
Here's what is currently happening:
http://gyazo.com/68717f66c498d850ef60ee83e1c0ae4a
And here is how it's suppposed to work (wxPython 2.8 in the pyfa app)
http://gyazo.com/87cc0f61052dca0e81c387da0f84c0c4
This is the module that I'm working on (the script has a test case if run directly): http://pastebin.com/ghuVGXWN
Any ideas?
I had to remove self.SetMinSize(sz) from OnStateChange, works great now.

Black preview screen working with Expression.Encoder and webcam

I wrote some C# code interface with a Logitech webcam using Expression.Encoder. The code was pretty easy to set it and works beautifully on my machine and my tester's machine. Unfortunately out in the field the preview screen for the camera shows a black screen. I've confirmed the camera displays a feed in both Logitech's app and also MS's Expression application. Windows Media Player and DirectX 11 are installed. The problem seems to be in the preview window creation that someone is not working.
// create the camera feed with just a video
currentJob = new LiveJob();
currentDeviceSource = currentJob.AddDeviceSource(currentVideoDevice, null);
System.Drawing.Size size = new System.Drawing.Size(250, 275);
currentDeviceSource.PickBestVideoFormat(size, (long)15);
SourceProperties sp = currentDeviceSource.SourcePropertiesSnapshot();
pnlCameraPreview.Size = new System.Drawing.Size(sp.Size.Width, sp.Size.Height);
currentJob.OutputFormat.VideoProfile.Size = new System.Drawing.Size(sp.Size.Width, sp.Size.Height);
// attach to the preview panel
currentDeviceSource.PreviewWindow = new PreviewWindow(new HandleRef(pnlCameraPreview, hwndPreviewPanel));
currentJob.ActivateSource(currentDeviceSource);
The Panel in question (pnlCameraPreview) is a windows forms panel hosting inside of wpf. Any thoughts on why this isn't working would be appreciated!
We use the approach in production. It works all the time but the problem in question can be reproduced on a fresh box when no native video card drivers are installed. Perhaps the root of the problem is with painting video over the panel. BTW while the problem with the code similar to the posted one is observed Skype and Encoder's preview displays webcam pics all right.
Preview panel starts show pics and the code starts to work properly after all the adapters's drivers are installed.

adobe edge animation not rendering in iOS 6

I've created a very simple animation in Adobe Edge Animate that animates a box moving from the bottom right to the top left.
I've imported this file (html + all other files) into my Xcode (v4.5.2) project but get a blank white screen in the simulator. I know my project is fine because if I copy a static html page into the project it renders correctly.
Any ideas?
since the difference between your project and the test page is that your project links to javascript files while the test page did not, maybe you should run a test with a page that calls a simple javascript library.
There are a few threads on adobe forum about some problems with projects opened on ios 6 devices. Maby this also concerns your project.
http://forums.adobe.com/message/4767681
Try to call this method and add some js code to your webview's document:
[webView stringByEvaluatingJavaScriptFromString:#"window.requestAnimationFrame = window.setTimeout;"];

HTML5 video on iOS5 not loading/showing

I have an HTML/JS app running in a webview in an iPad app. The app uses the HTML5 video tag. Videos work fine in iOS4.3 but today I've tested on iOS5 and the videos simply do not show up.
I have verified that it is not a layout related issue by setting background color and borders on the video element.
The same behaviour is evident irrespective of whether the app is run directly in mobile safari /from the home screen or within the webview.
The template for the video is simply:
<video controls src='{url}'></video> //where {url} is substituted at runtime.
The relevant video url plays correctly directly in the mobile Safari on iOS5.
I have tried to proxy the app comms and it seems that it does start loading the video but then stops, no video controls show and only the background color I have set shows thru.
Any ideas would be greatly appreciated. Thanks.
Have you tried create an empty webview, without additional parameters and scripts and make sure that you call it only once? I had the same issue when i call it twice without clearing previously created one - just audio was played.
Try to look at http://blog.millermedeiros.com/2011/03/html5-video-issues-on-the-ipad-and-how-to-solve-them/ and see if the fix works for you...
he he - should have read the fine print - did not notice you had answered yourself - remember to tick the thread off as answered
I've fixed this in code by changing the width and height by a pixel once the video element is created. Must invoke a repaint or something to that effect

Iphone route-me application issue

I am using route-me MapView for displaying offline map. It works well in the sample. I followed the Embedding guides and added the MapView.XCodeProj to my Xcode project it compiles successfully. But in my viewcontroller if i add RMMapView view as a subview to main view. It gives an error as "RMMapView refrence not found"
Need a bit more information, the exact error output would be helpful, but it sounds like you are missing the libraries. Make sure that libMapView.a has been added to Target->Build Phases->Link Binary With Libraries.
You might want to double check every step of the embedding guides.
Ciao!
-- Randy

Resources