-
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.
Separated positional overlay code into regions. Added HyperlinkOverlay
- Loading branch information
1 parent
0bef1db
commit 6f6acda
Showing
11 changed files
with
177 additions
and
82 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
93 changes: 93 additions & 0 deletions
93
src/main/java/me/piitex/renjava/gui/overlay/HyperlinkOverlay.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,93 @@ | ||
package me.piitex.renjava.gui.overlay; | ||
|
||
import me.piitex.renjava.api.loaders.FontLoader; | ||
import me.piitex.renjava.api.scenes.transitions.Transitions; | ||
import me.piitex.renjava.gui.overlay.events.IOverlayClick; | ||
import me.piitex.renjava.gui.overlay.events.IOverlayHover; | ||
|
||
public class HyperlinkOverlay implements Overlay { | ||
private final String label; | ||
private final String link; | ||
private FontLoader font; | ||
private double x, y; | ||
|
||
private Transitions transitions; | ||
private IOverlayHover iOverlayHover; | ||
private IOverlayClick iOverlayClick; | ||
|
||
public HyperlinkOverlay(String label, String link, double x, double y) { | ||
this.label = label; | ||
this.link = link; | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
public HyperlinkOverlay(String label, String link, FontLoader font, double x, double y) { | ||
this.label = label; | ||
this.link = link; | ||
this.font = font; | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public String getLink() { | ||
return link; | ||
} | ||
|
||
public FontLoader getFont() { | ||
return font; | ||
} | ||
|
||
public void setFont(FontLoader font) { | ||
this.font = font; | ||
} | ||
|
||
@Override | ||
public double x() { | ||
return x; | ||
} | ||
|
||
@Override | ||
public double y() { | ||
return y; | ||
} | ||
|
||
@Override | ||
public void setX(double x) { | ||
this.x = x; | ||
} | ||
|
||
@Override | ||
public void setY(double y) { | ||
this.y = y; | ||
} | ||
|
||
@Override | ||
public Transitions getTransition() { | ||
return transitions; | ||
} | ||
|
||
@Override | ||
public void setOnclick(IOverlayClick iOverlayClick) { | ||
this.iOverlayClick = iOverlayClick; | ||
} | ||
|
||
@Override | ||
public void setOnHover(IOverlayHover iOverlayHover) { | ||
this.iOverlayHover = iOverlayHover; | ||
} | ||
|
||
@Override | ||
public IOverlayClick getOnClick() { | ||
return iOverlayClick; | ||
} | ||
|
||
@Override | ||
public IOverlayHover getOnHover() { | ||
return iOverlayHover; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package me.piitex.renjava.gui.overlay; | ||
|
||
public interface Region { | ||
double scaleX(); | ||
|
||
double scaleY(); | ||
|
||
void setScaleX(double scaleX); | ||
|
||
void setScaleY(double scaleY); | ||
|
||
double width(); | ||
|
||
double height(); | ||
|
||
void setWidth(double width); | ||
|
||
void setHeight(double height); | ||
} |
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