v3.0.0: added a new 'heavy' transparent toast chrome

used for tooltips, inventory pane, and right click menus
This commit is contained in:
Evan Debenham
2024-11-13 15:11:32 -05:00
parent d867563d1e
commit c01760a394
5 changed files with 8 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -28,6 +28,7 @@ public class Chrome {
public enum Type {
TOAST,
TOAST_TR,
TOAST_TR_HEAVY,
TOAST_WHITE,
WINDOW,
WINDOW_SILVER,
@@ -55,6 +56,8 @@ public class Chrome {
case TOAST_TR:
case GREY_BUTTON_TR:
return new NinePatch( Asset, 20, 9, 9, 9, 4 );
case TOAST_TR_HEAVY:
return new NinePatch( Asset, 29, 9, 9, 9, 4 );
case TOAST_WHITE:
return new NinePatch( Asset, 29, 0, 9, 9, 4 );
case RED_BUTTON:

View File

@@ -114,12 +114,9 @@ public class InventoryPane extends Component {
@Override
protected void createChildren() {
bg = Chrome.get(Chrome.Type.TOAST_TR);
bg = Chrome.get(Chrome.Type.TOAST_TR_HEAVY);
add(bg);
bg2 = Chrome.get(Chrome.Type.TOAST_TR);
add(bg2);
blocker = new PointerArea(0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height){
@Override
protected void onClick(PointerEvent event) {
@@ -211,10 +208,9 @@ public class InventoryPane extends Component {
width = WIDTH;
height = HEIGHT;
bg.x = bg2.x = x;
bg.y = bg2.y = y;
bg.x = x;
bg.y = y;
bg.size(width, height);
bg2.size(width, height);
float left = x+4;
for (InventorySlot i : equipped){
@@ -264,7 +260,6 @@ public class InventoryPane extends Component {
public void alpha( float value ){
bg.alpha( value );
bg2.alpha( value );
for (InventorySlot slot : equipped){
slot.alpha( value );

View File

@@ -64,7 +64,7 @@ public class RightClickMenu extends Component {
}
private void setup(Image icon, String title, String... options){
bg = Chrome.get(Chrome.Type.TOAST_TR);
bg = Chrome.get(Chrome.Type.TOAST_TR_HEAVY);
add(bg);
this.icon = icon;

View File

@@ -73,7 +73,7 @@ public class Tooltip extends Component {
protected void createChildren() {
super.createChildren();
bg = Chrome.get(Chrome.Type.TOAST_TR);
bg = Chrome.get(Chrome.Type.TOAST_TR_HEAVY);
add(bg);
text = PixelScene.renderTextBlock(6);