In my game you can control the character by moving left and right, jumping and attacking. (This is a mobile game) I have a button that I use to jump and attack, which is easy because I just make a button and jump or attack with OnClick(). But for moving, I don't know how to find out if the user is pressing the button, I only know when it is clicked. How can I find this out? thanks.
If you dont understand what Im trying to say, basically here is my web game: http://dugelstudios.weebly.com/weapon-plus-plus.html
(Does not work on chrome, using safari or internet exploror)
and i am porting it to mobile, and i dont know how to make the player move left and right with touch controls.
You can use other MonoBehaviour methods such as OnMouseOver to check if a button is pressed, OnMouseEnter when a user begins to press a button, and OnMouseExit to check if a user has released the button.
You can also use OnMouseUpAsButton to mimic the behaviour of Button.onClick
For draggings movements, (like movement. For example, if you have a thumbstick, or something similar for movement), you can use OnMouseDrag.
Also, completely unrelated to your question, but something you have mentioned, you can enable NPAPI to enable WebPlayer builds in Chrome.
Just paste chrome://flags/#enable-npapi in a new tab in Chrome, and click the "Enable" button to get it running
I believe there is a thumb stick asset the standard Unity asset pack that's available on the store.
Related
I have an interactive pdf document that is displayed fullscreen. there's a navigation bar that users can press to jump to different pages.
What I need is some sort of looping screensaver (a collection of photos) that can be enabled by the user pressing a button.
I considered dropping in a video of a slideshow that I made in after effects, until I realised it's not that easy to loop the playback of that video!
How can I loop a video that I have placed onto a page in a pdf? I've read somewhere about swf's looping but I've tried that and there's no loop option when I place the file in acrobat?
Can someone give me some advice as I thought it would be pretty straightforward to loop a video and now it's looking far from easy.
Thanks
If it is just a slide show, meaning changing images at regular intervals, a few things could be done with Acrobat/Reader's on-board means.
In Full Screen, Acrobat allows to cycle through pages every whatever second. A button on those "screensaver" pages would get back to a "real" page. The question is whether that would interfere with the rest of the document.
Another approach would be having a Button field, icon only, read-only, no action, where you would show an image (preferably PDF) as an icon, and have a control loop running (using interval, timeout) loading different icons. This could be implemented with quite little JavaScript.
I am trying to build a virtual mouse by detecting finger movements with opencv. The finger detection is done. But I am stuck in mouse click function.
My work is similar to this :
http://8a52labs.wordpress.com/tag/colored-finger-tracking
But he has done in Windows. I am working in linux. I just want a library which provides me functions for doing left click, right click, mouse movement etc.
I am working with Fedora 16 , opencv and QT.
P.S - I have already moved the mouse cursor in Qt by QCursor::setPos(mouseX,mouseY);
But there is no function to make left click and right click.
If you want to do this system-wide, rather than just restricted to your Qt application, see this answer.
You need to post a QMouseEvent through QCoreApplication::postEvent(QObject* receiver, QEvent* event).
We've got a fairly basic implementation of the PivotViewer that we've put on a HP touch screen PC. Everything works as expected - and on the left hand pane you can select options, clear options etc.
The problem is when you select a card, the right hand pane is displayed as expected, but if you choose an item from this right hand pane (although this action works and the screen animates to show the new results) the next time you select an item the right hand pane is blank.
You get this behaviour even when you use the mouse on the touch screen.
Does anyone have any ideas please?
This same implementation works fine on every other PC - just not the touch screen where it is to be deployed!!
Although other samples I downloaded gave the same behaviour on the touch screen I found that a sample showing a custom details pane sorted things out.
I downloaded the sample from here:
http://tonychampion.net/blog/index.php/2011/10/sl5-pivotviewer-custom-detailpanestyle/
It worked much better on the touch screen anyway as I made big buttons on my custom pane, rather than the hyperlinks that were there before.
Hi I am working on one project on one page there are many controls like hyperlinkbutton, buttons, borders all these bounded by viewbox. when page loads all the buttons shows hand cursor but if i mouse over any other buttons this first buttons do not show any hand cursor or do not take any mouse event. But I abserved one strange thing here when i make full screen in browser buttons will show hand cursor when i disable the full screen view I abserved hit area of the button is above one 2cm from the respective buttons.
I browsed many sites I could not get the answer.
among them I pasted one link here so that you can understand well
http://forums.silverlight.net/t/44026.aspx
So can any one help me help me to resolve this? Please Help me.
Im developing an app for Microsoft Surface and Im trying to make the most of the libraries that are out there, the functionality Im after if to be able to flick a UI element.
The ScatterView control makes this easy, but I would like to restrict the UI element to only be able to be flicked along a set path. This is where Im having trouble.
So my questions are:
1) Can you restrict a ScatterViewItem to only be flicked along a path?
2) If not, how would you implement a flick gesture to flick a UI element along a set path?
Thanks!
Mark
1) Not that I know of, and this probably isn't the best way to approach it.
2) Assuming you have the object you want flicked and the path at design-time, I've previously implemented dragging and flicking along a path by creating a timeline animation that represents the movement across the entire path. At runtime, I capture contacts on that object, feed them to a Affine2DManipulationProcessor, and seek the animation based on the manipulation events.
So in my case I was creating a drawer. When the user touched the drawer, I start the animation and pause it immediately. If the user drags it open, I seek the animation the appropriate amount forward based on how far the manipulation processor tells me they've moved.
To get the flick behavior, you just hand off the manipulation to the Affine2DInertiaProcessor and continue handling the delta events.
This all works surprisingly well.