Page MenuHomeFeedback Tracker

DrawIcon with "Center" Aligned Text Covers Icon
Closed, ResolvedPublic

Description

drawIcon's "center" text alignment setting is broken. It renders the text in the dead centre of the icon, obscuring it.

http://i.imgur.com/7GKbEj3.png

Details

Legacy ID
851653207
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. Open Editor.
  2. Place a unit.
  3. Launch mission, in debug console put:

(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", {(_this select 0) drawIcon ["\A3\ui_f\data\map\markers\nato\b_inf.paa", [1,1,1,1], getpos player, 50, 50, 0, "player", 0.1, 0.1, "PuristaMedium"]}]

  1. Open map.
  2. The text covers part of the icon.
Additional Information

No mods used.

Event Timeline

voiper edited Steps To Reproduce. (Show Details)May 6 2015, 2:35 AM
voiper edited Additional Information. (Show Details)
voiper set Category to Scripting.
voiper set Reproducibility to Always.
voiper set Severity to None.
voiper set Resolution to Fixed.
voiper set Legacy ID to 851653207.May 8 2016, 12:02 PM
Bohemia added a subscriber: Dwarden.May 6 2015, 2:35 AM
Adam added a subscriber: Adam.May 8 2016, 12:02 PM
Adam added a comment.May 6 2015, 11:14 AM

Hello, the code for the init field you have provided is not working. Could you please check if it is typed correctly? Thank you!

@OP you must be confusing this with drawIcon3D, where the txt goes under the icon. drawIcon always had text inline with icon and default position of the text was to the right of the icon.

If you need to make it under the icon, make icon that has large transparent section under the icon.

EDIT: I see, all that changed is that default position of the text if you do not specify align is center, where as before it was right.

voiper added a subscriber: voiper.May 8 2016, 12:02 PM
voiper added a comment.May 6 2015, 7:04 PM

I was wondering if I was misremembering... Updated description.

I don't see the purpose of the centre align if it's just going to cover the text. It should adjust the text position based on the size parameters, or at least act like drawIcon3D.

KK has updated the reproduction steps to work.

The purpose of centre align is when you are not using icon but only text it is perfectly central. Also you might have hollow icon, a shape, you want to put text inside, then it is important that the text is dead middle.

As I said before, if you want text to appear under icon, you can make custom icon that is offset by large transparent area at the bottom of the icon. Then the text will appear over that area, while icon will look like it is above it.

OMG, I thought this was a typo that default text layout was set to "left", well it is not. Why? it look like this now (TODAYS DEV)

mytexext [ICON]

It was

[ICON] mytext

before and this is how many people use it. This is how it was before someone messed it up, why make it even more strange?

fixed in todays dev