protected static UIButton ConfigureActionButton(UIComponent parent, CommonsSpriteNames spriteName) { KlyteMonoUtils.CreateUIElement(out UIButton actionButton, parent.transform, "Btn"); KlyteMonoUtils.InitButton(actionButton, false, "ButtonMenu"); actionButton.focusedBgSprite = ""; actionButton.autoSize = false; actionButton.width = 20; actionButton.height = 20; actionButton.foregroundSpriteMode = UIForegroundSpriteMode.Scale; actionButton.normalFgSprite = KlyteResourceLoader.GetDefaultSpriteNameFor(spriteName); return(actionButton); }
public static UIButton ConfigureActionButton(UIComponent parent, CommonsSpriteNames sprite, MouseEventHandler onClicked, string tooltipLocale, float size = 40) { KlyteMonoUtils.InitCircledButton(parent, out UIButton actionButton, sprite, onClicked, tooltipLocale, size); return(actionButton); }
public static void InitCircledButton(UIComponent parent, out UIButton button, CommonsSpriteNames sprite, MouseEventHandler onClicked, string tooltipLocale, float size = 40) => InitCircledButton(parent, out button, KlyteResourceLoader.GetDefaultSpriteNameFor(sprite), onClicked, tooltipLocale == null ? null : Locale.Get(tooltipLocale), size);