-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New UiObjects and mouseManager refactored
1. Mouse manager extends from MouseAdapter 2. UiSlider added 3. SettingsSate created with a basic UiSilder 4. UiElements added to the states and to res folder
- Loading branch information
Showing
18 changed files
with
379 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/uninorte/base/game/states/SettingsState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.uninorte.base.game.states; | ||
|
||
import com.uninorte.base.game.Handler; | ||
import com.uninorte.base.game.ui.UISlider; | ||
|
||
import java.awt.*; | ||
|
||
public class SettingsState extends State { | ||
|
||
public SettingsState(Handler handler) { | ||
super(handler); | ||
|
||
initComponents(); | ||
} | ||
|
||
private void initComponents() { | ||
int x = (int) (handler.boardDimensions().width * 0.5f - 128 / 2); | ||
int y = (int) (handler.boardDimensions().height / 2 + 101); | ||
|
||
UISlider uiSlider = new UISlider(this, x + 30, y / 2, 30, 40, (System.out::println)); | ||
uiSlider.setValue(20); | ||
|
||
uiManager.addObjects(uiSlider); | ||
} | ||
|
||
@Override | ||
public void update() { | ||
uiManager.update(); | ||
} | ||
|
||
@Override | ||
public void render(Graphics g) { | ||
uiManager.render(g); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.uninorte.base.game.ui; | ||
|
||
public interface MouseListener { | ||
void onMouseChanged(float value); | ||
} |
Oops, something went wrong.