x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do you restrict a button to only be visible inside a canvas in UMG?

Hey, so i'm working on a menu that have several different buttons that are being drawn to the screen. I have also made a simple way to drag the buttons around using the mouse using SetRenderTranslation. But what i cannot figure out is how i could do so that the buttons only get drawn inside the canvas they are inside in the hierarchy. alt text

This is what it looks like at the moment, what i would like to achieve is so that when i drag the button to the location in the image only the small part inside the white window is shown, not the entire button. Does anyone know a way to do this? Any help is appriciated.

Product Version: Not Selected
Tags:
umg.png (370.3 kB)
more ▼

asked Mar 10 '15 at 09:58 AM in Blueprint Scripting

avatar image

Solicio
200 54 53 64

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You should be able to toggle the visibility using remove from parent or set visibility. You are going to have to do some math though. Create a second 2D vector that adds the width and height of your container there. Those two vectors will give you your boundaries.

Get the coordinates of your widget (should return top left most corner). In your update, loop, check the widget that you are dragging's location. On each update, check if button coordinates are within the range of values.

x1y1< i < x2y2

If its within range, do nothing, else, remove from parent.

more ▼

answered May 26 '15 at 07:36 PM

avatar image

RAVaught
699 43 28 68

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question