Forum rules - please read before posting.

Drag element

Hi Chris,

I am trying the drag element function in AC menu but encouter problems, would you pls help?

I set the game screen size to 1920x1080 and I would like to drag a large image, 1000x2000 in the game.

So, I create a new menu and set it auto size and align to upper left. I create a drag element in the menu and delete the button text (I want it an image) and set the BG texture (1000x2000) and also make this drag element align and auto size. I set the drag type to entire menu and drag boundary to both width and height to 100 and position 0,0. So the image can be dragged in the whole screen.

And the result is when cursor press the image (drag element, 1000x2000 pixel), it shows the lower end of the image and when I press the image again, it shows back the upper end of the image again. It does not like dragging the image vertically. But the image can be dragged horizontally.

But if I set the drag element size from auto to smaller size within the screen. Then the smaller image can be dragged freely horizontally and vertically.

So, is the drag element only allow to drag an image with size less than the screen size? Can you pls help? As I would like to drag a large image which is greater than the screen size, is it possible in AC? Thanks.

Comments

  • The Drag element is quite basic, and has long been superceded by Unity's own ScrollView component.

    In a fresh scene, without converting it to AC using the Scene Manager, choose "GameObject -> UI -> ScrollView" from the top toolbar, and resize it to suit. To the Content child object, add an Image that displays your graphic, resized to suit.

    Without involving AC, tweak things until the behaviour is right. The Horizontal and Vertical Scrollbars can be hidden from view once things work OK.

    Then switch your Menu's Source over to Unity UI, and use this UI Canvas as its Linked Canvas Prefab.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.