I have created a game that basically add the numbers in the blocks to each other by dragging them on top of each other. It works great. But I would like to add sound effects to the drag and drop move that is being done with the floatanimation feature of the button. I couldnt see an event or a property that handles this action.
How could I include a sound effect to the floatanimation of the pressing, draggin and dropping of an object (such as button) ?
Thank you.
Raf.
try using TMediaPlayer, before you start your TFloatAnimation
Related
I needed a control with Run, Stop and Step buttons and thought I would put a TMediaPlayer to work. It has the buttons I need and I can control the enables and use of colour.
If I drop one onto a form and compile and run - the buttons are all disabled. I unchecked the AutoEnable property and now the buttons are enabled when I run, but as soon as I click any of them I get an error No MCI Device Open.
I get that it's a media player and I haven't told it anything about any media, but is there a way of getting it to run in a media-free environment?
If your question is whether you can use TMediaPleyer buttons to control other things then I'm afraid the answer is NO.
The mentioned buttons are part of TMediaPlayer component itself and are only designed to control the Media Control Interface (MCI) driver.
Their purpose is to make working with MCI driver much easer as you don't need to link bunch of your buttons to the TMediaPleyer component as you would have to do otherwise.
So I'm afraid you will have to make your own set of buttons to do your thing.
You might want to learn about TRadioButton to see how to group multiple buttons together in a way so that only one of them can be pressed down at one time to mimic some functionality of TMediaPlayer buttons.
I have a .xib with two UIButtons right next to each other.
When I start up the app, everything looks fine. Once I push play, the audio starts, the button turns to pause, and everybody is happy.
If I push stop, the play button moves to the left, and leaves a trail of dots...
In iOS 6, this was not an issue.
Does anyone know why this might be happening??
Looks like at some point a title of '...' is being added to that Play button. That's just a guess, but the default layout for a button is to have the image on the left and the title on the right.
There is a few things you can do.
First, clear all constraints in window like below...
Second... Check all the states of your button (interface and code), see if you didn't add a title '...' to your button in the active state or the enabled and disabled state.
here is the picture update to see it clearer...
So my problem is that I have a TJvDocServerForm with an image inside, now all functionality works when its pinned, however when its unpinned and I try to use the mousewheel to zoom, the form hides straight after the zoom operation.
The zoom works through a scrollboxmousewheel event that triggers a
timer.
The timer then redraws the larger/smaller image through my own
image class when movement on the mousewheel has stopped.
Through break points it appears the draw is causing the form to
hide.
I believe this has got something to do with the focus being lost, however resetting the focus back to he form directly after the draw does not stop the hide as it has already been told to hide.
Is there a way to somehow lock the form from hiding until after the image has been redrawn?
This functionality (the unpinning thing) is rarely used. This code is extremely complex, and changing it is not recommended unless you like causing regressions. How common is the combination of mouse wheel + unpinning? So rare, I'd let it go, if I were you. If you can live without the unpin feature at all, just change dock styles. Personally I hate the unpinned state and I use a dock style that doesn't even support it. The unpinned "zoom away" animation may be directly linked to the focus-loss. You could store that state, wait until the next time through the message loop and then trigger the animation, if you wanted to, but even I, who have done lots of work in JvDocking source code, would be hesitant to try it.
I need to know is some object being dragged over my Delphi application.
For example: while the user dragging some item from ListView to ListBox, or dragging some file from Explorer into my LitsView, I want to check at any moment is he still dragging or not dragging anymore.
Can I find this without hooking drag events?
Delphi XE
I would do this by making a note when the drag process starts, for example when IDropTarget.DragEnter is called. And then reset the flag when the DragLeave or Drop is subsequently called.
I'm developing a game that is mixed with winforms (for the map editor). The problem I am facing is that even if the main game window isn't in focus, it still receives mouse change events (such as clicking and moving the mouse).
Is there a way to make sure my application is in focus before continuing on to handle these events are is there some kind of built in method?
Thanks!
Use the Game.IsActive property to check if you should deal with mouse and keyboard input.
If you add a reference to System.Windows.Forms you can check if the XNA window is active like this:
if (System.Windows.Forms.Form.ActiveForm ==
(System.Windows.Forms.Control.FromHandle(Window.Handle) as System.Windows.Forms.Form))
{
// Active form is the XNA window.
}