I am trying to make transparent (legacy) buttons in unity. I want to be able to see the button text, but not see the background button image (aka the 'clickable' area). I am not asking about hiding/showing the button and the text completely.
I have tried disabling the button, removing the Target Graphic image, setting the alpha values to 0, but none of these seems to have any effect.
Do I need to just remove the button object and write some sort of script that hangs off a text object to detect clicks?
Addendum: Geode's suggestion works nicely. Either deleting or disabling the image component will solve this problem.
I think you've been looking in the wrong area, above your Button component there is an image component which handles the graphics part of your button. Disabling or removing that will remove the white background.
Here you can see the location
Related
I would like to reproduce a Control in my WindowsFormsApplication that is equal to the refresh Button of the Windows Network connection form.
Does anybody know which Control it is or how to build a equal one in C#? It seems to be a PictureBox but if you hover it with the Cursor it gets a semi transparent blue colored overlay.
you can use XanderUI for this, add the button, change the button image and change both hover and click background colors to whatever color you like
I am trying to create a game where I have to display different pictures when different buttons are clicked.
The problem when one button is pressed image appears behind all the other buttons (Except the button which is clicked to display that image). I have attached screenshots to describe my problem better. Please suggest a solution to overcome this problem.
Screenshot of the game with all Buttons :
Button when clicked Image appears but all the other buttons are infront of the image :
put a boolean to hide the buttons if the image is shown.
You need guiDepth
http://docs.unity3d.com/ScriptReference/GUI-depth.html
yourButton.guiDepth = 0;
0 = on top of everything
I'm using C# and WinForms.
When using a button with a BackgroundImage property, when I enable/disable the button, the image doesn't get gray... Result : The user is unable to tell if the button is enabled or disabled without trying to click it.
When using a button with a Image property, the image's behavior is correct but the image is not centered in the button !
As you can see in the picture, the first button uses BackgroundImage , the second one uses Image property but the minus sign is not centered properly... How can I manage this enable/disable state with a proper image's behavior ?
Thanks in advance !
I was doing the same thing some time ago and everything worked out by just using the Image property. You could try to set ImageAlign:
button.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
Maybe increase the dimensions of the button to see if that changes anything (maybe the image is just too big for the disabled button. All I can tell you is that it should work perfectly using the Image property.
We have a mapping form in our application that needs a Google Earth background image, and as you can't use the Google Earth plugin in a browser that is under a panel, we use a second form to show the background image. We have a transparent panel on the mapping form that the drawing is done on while Google Earth is drawn on a form held in sync below.
We achieve transparency by giving the form a transparency key of 255, 250, 250 and setting the panel background to this color before drawing on it. Although now after looking at the information available online it appears that the panel shouldn't ever get cursor events.
This works perfectly in most cases, but on one or two customers machines (one is definatly Windows 7) the cursor will not work correctly on the panel where it is transparent. If the cursor is placed over a drawn area of the map then it all work fine.
I think the issue is due to transparancy click through but as it works in most cases I'm not sure what is exactly going on. We've updated all of the graphics drivers to see if there is a custom setting on the customers machine but this hasn't helped.
Does someone have a definative description of what the transparency key does? Is there a way to absolutly set that the panel should recieve the mouse events?
EDIT
Added detail about transparency key.
Try intercepting the WM_HITTEST message in the WndProc for the Form window and when you know it is over the client area return the appropriate HTCLIENT value. It could be that the default window processing is sometimes returning a different value.
Stevo - Have you ever figured out an answer to this? I had the same problem and figured out to change the transparency key of the main form to some odd color. May or may not help you. I had a custom control with transparency but the forms key color was also my drawing color, thus allowing it to click through (strangely). I changed it and it worked!
I'm new to WPF so I've got a problem:
I need to create a grid. This grid should contain a column with a kind of thumbnails.
When I move mouse over a thumbnail, there should appear a panel with a big image. This panel will cover all grid.
But this will make thumbnail think that mouse already has gone.
After mouse's gone, panel should dissappear. Mouse appears above thumb again, and panel appears. And again, and again. I don't know how to handle this.
Could anybody suggest any solution?
Sounds to me like you want to use IsHitTestVisible="False" on the image that pops up. This will make it ignore the popup when testing where the mouse is, so it will think your mouse is still over the thumbnail image. This should work on any UI element, except windows.
Use MouseEnter and MouseLeave:
http://www.hanselman.com/blog/MouseEnterAndMouseLeaveLoopsInWPF.aspx
There are two ways I can think of to do this, depending on what kind of functionality you're looking for.
If you want the larger image to appear in proximity to the mouse and the thumbnail, then you might want to take a look at using a Tooltip.
Otherwise as Aliostad mentioned above, you could use the MouseEnter and MouseLeave events to trigger the display of whatever content is needed.