Added snap to grid + local/world space UI
This commit is contained in:
@@ -61,11 +61,11 @@ ui_button_no_border :: (text: string, identifier: s64 = 0, loc := #caller_locati
|
||||
return box.interaction.clicked, box.interaction;
|
||||
}
|
||||
|
||||
ui_toolbar_button :: (text: string, identifier: s64 = 0, loc := #caller_location) -> clicked: bool, Interaction_State {
|
||||
ui_toolbar_button :: (text: string, background_color: Color = .{0.1,0.1,0.1,1}, identifier: s64 = 0, loc := #caller_location) -> clicked: bool, Interaction_State {
|
||||
ui_set_next_text(text);
|
||||
ui_set_next_border_width(1);
|
||||
ui_set_next_border_color(.{0.5,0.5,0.5,1});
|
||||
ui_set_next_background_color(.{0.1,0.1,0.1,1});
|
||||
ui_set_next_background_color(background_color);
|
||||
ui_set_next_text_color(.{1,1,1,1});
|
||||
ui_set_next_size_x(.TEXT_DIM);
|
||||
ui_set_next_size_y(.TEXT_DIM);
|
||||
@@ -74,7 +74,7 @@ ui_toolbar_button :: (text: string, identifier: s64 = 0, loc := #caller_location
|
||||
ui_set_next_padding_top(5);
|
||||
ui_set_next_padding_bottom(5);
|
||||
//ui_set_next_text_alignment(.CENTER_HORIZONTALLY | .CENTER_VERTICALLY);
|
||||
box := ui_box_make(.CLICKABLE | .DRAW_BORDER | .DRAW_TEXT | .ANIMATE_ON_HOVER, get_hash(loc, identifier));
|
||||
box := ui_box_make(.CLICKABLE | .DRAW_BORDER | .DRAW_BACKGROUND | .DRAW_TEXT | .ANIMATE_ON_HOVER, get_hash(loc, identifier));
|
||||
return box.interaction.clicked, box.interaction;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user