# Check if mouse cursor is on a image widget

**URL:** <https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852>\
**Category:** UI\
**Tags:** button, mouse-cursor, unreal-engine, Widget, question, Blueprint\
**Created:** [April 17, 2018, 4:11am UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852 "2018-04-17T04:11:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![RHERWOLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RHERWOLF](https://forums.unrealengine.com/u/RHERWOLF)\
**Post date:** [April 17, 2018, 4:11am UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/1 "2018-04-17T04:11:57Z")

</div>

Button widget has inappropriate behavior. I’m trying to simulate button widget with image widget. Can I check if mouse cursor is hovering a image? Can I define a non rectangular image region to hovered image? Thanks.

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [April 17, 2018, 11:06am UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/2 "2018-04-17T11:06:51Z")

</div>

Hi, why are you trying to to make an image work as a button? If you need a custom shape for you button check out [this](https://forums.unrealengine.com/community/community-content-tools-and-tutorials/96724-free-custom-shaped-buttons-custom-hit-box-for-any-button).

---

<div class="post-metadata">

**Author:** ![Velrin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Velrin](https://forums.unrealengine.com/u/Velrin)\
**Post date:** [April 17, 2018, 12:04pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/3 "2018-04-17T12:04:34Z")

</div>

> **[UWidget::IsHovered](https://docs.unrealengine.com/4.27/en-US/API/Runtime/UMG/Components/UWidget/IsHovered/)**
>
> Returns true if the widget is currently being hovered by a pointer device

---

<div class="post-metadata">

**Author:** ![RHERWOLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RHERWOLF](https://forums.unrealengine.com/u/RHERWOLF)\
**Post date:** [April 17, 2018, 1:16pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/4 "2018-04-17T13:16:04Z")

</div>

I need specifics button controls (without much of the standard properties).

---

<div class="post-metadata">

**Author:** ![RHERWOLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RHERWOLF](https://forums.unrealengine.com/u/RHERWOLF)\
**Post date:** [April 17, 2018, 1:19pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/5 "2018-04-17T13:19:00Z")

</div>

Can I define a non rectangular image region to hovered image?

---

<div class="post-metadata">

**Author:** ![MrMcKvarz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrMcKvarz](https://forums.unrealengine.com/u/MrMcKvarz)\
**Post date:** [April 17, 2018, 3:11pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/6 "2018-04-17T15:11:34Z")

</div>

What do you want your button to able to do?

---

<div class="post-metadata">

**Author:** ![RHERWOLF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RHERWOLF](https://forums.unrealengine.com/u/RHERWOLF)\
**Post date:** [April 17, 2018, 3:48pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/7 "2018-04-17T15:48:16Z")

</div>

Extern specification when uses normal, hovered, pressed and disabled styles (function call exchanges style when needed) and intern “collision between cursor and button” process (function call returns true if and only if mouse cursor is hovering the button, possible specify button shape).

---

<div class="post-metadata">

**Author:** ![7elich](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@7elich](https://forums.unrealengine.com/u/7elich)\
**Post date:** [December 30, 2020, 4:49pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/8 "2020-12-30T16:49:33Z")

</div>

I’m beginner but for ure probleme ihave an idea that worked for me. you can make array and u put all images and then unreal will check if any images have hovered

 ![325958-sans-titre.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/b/5cb928fc690459365001c556419729876dc194c8.png)

we can also help each athor contact me on facebook

> **[Log into Facebook](https://www.facebook.com/profile.php?id=100055526778936)**
>
> Log into Facebook to start sharing and connecting with your friends, family, and people you know.

---

<div class="post-metadata">

**Author:** ![TimNick151297](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TimNick151297](https://forums.unrealengine.com/u/TimNick151297)\
**Post date:** [August 7, 2023, 1:54pm UTC](https://forums.unrealengine.com/t/check-if-mouse-cursor-is-on-a-image-widget/422852/9 "2023-08-07T13:54:13Z")

</div>

It will definetely work, but it is not a good practice to iterate over a for loop in an event tick function. This is very expensive as it is processed every frame. Better solution would be to group the contents you want to check in an overlay panel or similar and check only that one panel. All of its children will automatically be checked as well.
