-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved image rendering and strand mode display
- Loading branch information
1 parent
9dbe149
commit 940b03b
Showing
20 changed files
with
169 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.woogleFX.engine; | ||
|
||
import com.woogleFX.editorObjects.EditorObject; | ||
import com.woogleFX.editorObjects.objectComponents.ImageComponent; | ||
import com.woogleFX.editorObjects.objectComponents.ObjectComponent; | ||
import com.woogleFX.file.FileManager; | ||
import com.woogleFX.file.resourceManagers.GlobalResourceManager; | ||
import com.woogleFX.structures.GameVersion; | ||
import javafx.geometry.Point2D; | ||
import javafx.scene.image.Image; | ||
|
||
import java.io.FileNotFoundException; | ||
|
||
public class EffectsManager { | ||
|
||
public static ObjectComponent getPlacingStrand(EditorObject goo1, double mouseX, double mouseY) { | ||
|
||
Image strandImage; | ||
|
||
try { | ||
if (FileManager.hasNewWOG()) | ||
strandImage = GlobalResourceManager.getImage("IMAGE_BALL_GENERIC_ARM_INACTIVE", GameVersion.NEW); | ||
else strandImage = GlobalResourceManager.getImage("IMAGE_BALL_GENERIC_ARM_INACTIVE", GameVersion.OLD); | ||
} catch (FileNotFoundException e) { | ||
return null; | ||
} | ||
|
||
return new ImageComponent() { | ||
public double getX() { | ||
double x1 = goo1.getAttribute("x").doubleValue(); | ||
return (x1 + mouseX) / 2; | ||
} | ||
public double getY() { | ||
double y1 = -goo1.getAttribute("y").doubleValue(); | ||
return (y1 + mouseY) / 2; | ||
} | ||
public double getRotation() { | ||
|
||
double x1 = goo1.getAttribute("x").doubleValue(); | ||
double y1 = -goo1.getAttribute("y").doubleValue(); | ||
|
||
return Math.PI / 2 + Renderer.angleTo(new Point2D(x1, y1), new Point2D(mouseX, mouseY)); | ||
|
||
} | ||
public double getScaleX() { | ||
return 0.15; | ||
} | ||
public double getScaleY() { | ||
|
||
double x1 = goo1.getAttribute("x").doubleValue(); | ||
double y1 = -goo1.getAttribute("y").doubleValue(); | ||
|
||
return Math.hypot(mouseX - x1, mouseY - y1) / strandImage.getHeight(); | ||
|
||
} | ||
public Image getImage() { | ||
return strandImage; | ||
} | ||
public double getDepth() { | ||
return 0.00000001; | ||
} | ||
public boolean isDraggable() { | ||
return false; | ||
} | ||
public boolean isResizable() { | ||
return false; | ||
} | ||
public boolean isRotatable() { | ||
return false; | ||
} | ||
}; | ||
|
||
} | ||
|
||
} |
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
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
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
Oops, something went wrong.