1,669 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
46
views
Textures for Animation class cause errors
I am creating a platformer game and currently working on the map area (where the player selects a level). While this code does work in eclipse, it does not work when exported to a .jar file. Yes, ...
1
vote
1
answer
130
views
Java Graphics fillArc() is not precise enough
(Specifically, I'm using Graphics2D, but it inherits the fillArc() method from Graphics, so I listed the question under that class.)
The fillArc method accepts its parameters in the following order:
...
2
votes
0
answers
560
views
Fontconfig head is null exception when running AWS Lambda
I am working on creating a Lambda function that uses Spring Boot. When the API is invoked, the application makes some API calls and creates an image containing some text, generated using Java ...
0
votes
2
answers
91
views
I'm trying to draw a 2d tile map from a .txt file in java but it is only using one of the tiles accross the map and not using whats in the .txt file
I'm following a java 2d game tutorial from ryisnow on youtube. https://www.youtube.com/watch?v=ugzxCcpoSdE
I was able to display each tile on its own but I don't know why the .txt isnt working
here is ...
1
vote
1
answer
69
views
Java Graphics2D fillRect creating wrongly sized squares with a pattern
I am having an issue with a custom drawn image rendered on the JPanel with Graphics2D. If I try to draw a 1x1 pixel for every x/y the width and length of the panel with fillRect it will create a bunch ...
0
votes
1
answer
92
views
How do I align the X and Y axis to adjust my zoomed in grid?
I'm doing this graphing project, but I came across this problem: everytime I zoom in or out my x and y axis are out of place. Any idea of how to fix this issue?
Here my code:
import javafx....
0
votes
1
answer
242
views
Draw Unicodes/UTF-8 characters such as 'ಠ' with AWT Graphics in Java
I'm trying to draw a face with such unicodes:
ಠ_ಠ
However, it produces rectangles instead.
I tried the following:
BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB);
...
0
votes
0
answers
48
views
Increase player jump height depending on how long they hold the jump button
I need some help making my final project in java, a game.
Here is the code I have now for jumping:
if (Keys.up) {
if (player[1] + player[3] >= base[1]) {
player[5] = -20;
}
}
This ...
0
votes
0
answers
55
views
why x11 xserver drawline is faster than directly write buffer?
x11 code
//use x11 api
for (int i = (xrectw >> 1) + cc; i < CANVAS_WIDTH; i += xrectw)
{
for (int j = (yrectw >> 1) + cc; j < CANVAS_HEIGHT; j += yrectw)
{
XDrawLine(...
0
votes
1
answer
97
views
Draw a traceable text on graphics 2D
I want to teach my kids to write numbers, thus I thought of drawing traceable letters to Graphics2D
I have tried the following approach
float[] textDash = {15.0f};
g2d.setFont(g2d.getFont()....
2
votes
0
answers
301
views
How to Create a Dynamic Cropping Tool with React Konva That Greys Out the Non-Cropped Area
I'm working on an image editing application using React Konva and have encountered a challenge in implementing a dynamic cropping tool. My goal is to allow users to select a crop area on an image, ...
1
vote
1
answer
38
views
Creation of new instances of an image slows down animation and creates flickering
I'm relatively new to programming in Java. I'm trying to create objects (apples) falling in different locations on the x-axis. However every time a new one is added to the ArrayList the image slows ...
0
votes
0
answers
19
views
Poor line quality withJS Graphics 2D Drawing [duplicate]
I am dismayed at the poor quality of lines I draw in Graphics2D. When I draw a line with
lineWidth=1 and strokeStyle="black" I would expect the line to look the same as the border of my ...
0
votes
1
answer
100
views
I have a small issue with drawingin Javascript Graphics 2D
Just for fun and learning, I am trying to create a web based forms editor in the manner of Visual Studio. First requirement is the ability to draw a rectangle so that the outline follows the mouse ...
2
votes
2
answers
85
views
(Game Design) Antialiasing in Java Graphics2d
I want to antialiase an image with shape (plane) I draw in it. I draw the plane image in Adobe AI and put them in my resource folder. The image looks like below.
When I use this line of code
g2....