Hi!,I would like the icon have an offset on Y so the user finger does not cover it when doing an item drag from the Inventory.
How could I configure that? Thanks in advance!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Assign the same icon in the item's Cursor (optional) property in the Inventory Manager. When this field is filled, you'll then get a new Click offset (from centre) field. If you set a positive Y value, the icon will be shifted upwards by that amount.
I recently had the same query and although this is a feasible solution it doesn't scale particularly well given the number of inventory items one is likely to have in their game. I've made the following minor additions to the AC source code (v 1.76.3) to ease the process and I wondered whether you'd consider incorporating them in to AC, Chris? Thanks.
CursorManager.cs
79:
265-271:
InvItem.cs
63:
358:
378:
CursorIcon.cs
810:
817-830:
Is the underlying intent here to provide a global click offset to all items, that can then be optionally overridden on a per-item basis? I can certainly consider that.
I would also mention, however, that the use of Unity UI for cursor rendering should be able to provide this - since the position of the RawImage's RectTransform (which displays the cursor) could be offset through animation when an item is selected.
Hi, yes, that's exactly it. If you could it'd be great, thanks. I thought this approach would be the cleanest as it adds functionality without changing anything existing.
Understood - though editing CursorIcon in that way isn't possible as it's used more widely than just for inventory.
Though it's a little different to the above, the most robust approach would be to provide a default offset that gets overridden if a separate Cursor texture is assigned for a given Inventory item. I'll see about implementing this in the next release - thanks for the suggestion.