Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Problem with image being truncated and/or not being resized (both) on: 2013-12-30 06:57:31
bump (i'm not sure if i can do this, i hope i can, i still have this issue ): )
2  Game Development / Newbie & Debugging Questions / Problem with image being truncated and/or not being resized (both) on: 2013-12-29 02:21:53
So i've been trying for over a day to solve this issue and i'm about to cry lol (ok maybe not that dramatic but close enough).

I'm trying to rotate an image but everytime i try no matter the method or it either truncates or it doesn't resize.

This is what i'm doing in general:

i have an image wich is (let say) 150 x 300 then when i draw it i resize to about 55% of its original size.

but on double click i have to rotate it 90 degrees (goes back and forth to 90 degrees, -horizontal and vertical position-)

and i have tried 2 methods but i get undesired behavior:

this is one:

cardImage is the original full-sized card.
flippedCardImage is where i store the flipped version of cardImage.

public void rotateImage (double degrees){
        ImageIcon icon = new ImageIcon(cardImage);
        BufferedImage blankCanvas = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = (Graphics2D)blankCanvas.getGraphics();
        g2.rotate(Math.toRadians(degrees), icon.getIconWidth()/2, icon.getIconHeight()/2);
        g2.drawImage(cardImage, 0, 0, null);
        flippedCardImage = blankCanvas;

with that code i get the image but it is shrinked.

and with this:

public BufferedImage rotateImage(BufferedImage img, double degrees) {

        //making image with the rotated size
        BufferedImage rotated = new BufferedImage((int) cd.getSCD().getHeight(), (int) cd.getSCD().getWidth(), img.getType());

        //We create a Graphics2D object...
        Graphics2D f = rotated.createGraphics();
        f.translate(rotated.getWidth()/2, rotated.getHeight()/2); //translate half the width and height
        f.rotate(Math.toRadians(degrees)); //rotate the image...
        f.translate(-img.getWidth()/2, -img.getHeight()/2); //translate-back to half the original width and height
        f.drawImage(img, 0, 0, null); //draw image        
        return rotated;

with that when i draw it it draws like if i cropped the 55% sized rectangle off the full sized image and draw that instead of resize it.

how do i do rotate and resize it properly can someone please help me? T_T
3  Game Development / Newbie & Debugging Questions / Re: Hi, just a few questions hehe on: 2013-05-01 22:04:11

Maybe you could have a look at JogAmp, we have some tutorials and tons of examples on Github (including those of the Red Book).
will check, thanks Cheesy

There is an "appreciate" button on every post - just press it for posts you - well - appreciate Wink

what? really? lol i'm sorry but i don't see anything anywhere haha

This is exactly what you should try to avoid: making your mind about stuff thats not related to the core gameplay/design.

There was a lot of discussion about how to secure a games content, it's networking, the highscore-table etc. Common wisdom is: just dont!

If your game is so successful, that people want to pirate or rip stuff out of it, you are a winner! Chances are, that nobody is interested in doing so - at least for your first game. And even if - what should they do with the art? If they do a fan game inside of the same universe - you should encourage and support them! If they use it as "placeholders" in their own hobby-game, you should feel honored.

Just provide some copyright and licensing readme along with your game and inside your games jars, so you can legally claim ownership of the content.

i don't mind about that at all, i was wondering because i won't make the designs myself and so the person that will was asking me about it but ill talk to him xD
4  Game Development / Newbie & Debugging Questions / Re: Hi, just a few questions hehe on: 2013-05-01 02:19:43
u_u it feels bad to give up on that (for now, i still want to do my own in a far future haha).

Btw does anyone know if there is a way to encrypt the images in the jar file? just for the game to be able to read the images and not people being able to take them off it. is it possible?
5  Game Development / Newbie & Debugging Questions / Re: Hi, just a few questions hehe on: 2013-05-01 00:22:52
Oooh i see, about the low budget is true sadly, about the time is quite limitless atm lol, not doing anything besides my own studies regarding gaming development, i don't work. About the visuals i have friends very interested in developing games with me so they will work for it, basically all i need to do is take care of the coding.

Since you guys mention i shouldn't avoid already created engines i will drop my pride and do it, i didn;t want to use them because id feel like i'm doing something without knowing its internal work and that kind of disturbs me (personal way to be i guess).

About the book hm i think i shall take a look at 1 at least to see how it goes, will read the one i linked in my main post and see how it turns out for me (guess i should have done that lol but i did want to ask for personal experiences on others).

thank you all for your responses and specially alaslipknot for the links, i will certainly look at what you linked and study it. Cheesy
6  Game Development / Newbie & Debugging Questions / Hi, just a few questions hehe on: 2013-04-30 09:45:48
Hello! :3
I'm sort of new in this community and i'm pretty sure i'll stick around for a long time haha. Found it in google while browsing for tutorials and usefull information about java gaming development (that account activation quiz made me laugh at my own stupidity btw lol)

Not sure if this is the right section to post this but it seemed the most appropriated one haha sry if i'm wrong.

So i'm very interested in game development, i dropped the idea years ago because there aren't any kind of studies related to game development in my country, everything is directed to company sided coding (you know like creating billing systems and such *puke*) but i recently found myself getting that idea again and i decided to set it as my goal, i want to develop games for living but i am still standing on somewhat shaky ground as in where to start so i'll very much appreciate some guidance.

to give a general idea i've been coding programs every now and then since 2008, i've made simple games in visual basic and c# such as Hanged, tic tac toe, rock/paper/scissors, the simple stuff. I've coded utilities for windows and some  silly mathematical stuff every now and then. The languages i've coded in are c++, c#, visual basic and since 4 days ago i've spent about 14 hours a day coding in java. I have a good grasp of the basics so im set with that.

My goal is to code 2D games, even tho in some places says those aren't as good as 3D i strongly disagree, id rather play some good gba game such as Golden Sun again rather than Devil May Cry 4, of course thats not all the time but i think 2D games do have a lot of potential.

I do not want to make games based off an already made engine, id like to learn to do everything from scratch by myself no matter what it takes.

I've watched and finished few dozen of basic gaming tutorials but  they don't really hmm "enlight" me as in they don't answer all the questions i have, and looking for very specific questions in google is massively time consuming.

I have very very limited resources (money-wise lol) so i can't really afford to buy a book that i'm not sure if will help me or not (sorry if that comment seems stupid, i never read a programing book in my life so i have no idea). So i would like to know if is actually worth spending $75 in a book? (to give an idea of how expensive that sounds to me $75 is 1/4 of a full time employee's monthly paycheck).

I got this book: Killer Game Programming in Java somewhere in the internet but there are some books that are just not possible to find that seem interesting.

Will it be worth my time to actually read 1000ish pages of a book or do i just keep looking/watching for tutorials? (like i said, sorry if it sounds really stupid and ignorant D: i have never read a book about programing, all i know comes from google lol)

How should i set my way to study?

Sorry for the long post lol. I am open to suggestion and knowing your personal experiences, itd help me greatly!
Pages: [1]
DesertCoockie (34 views)
2018-05-13 18:23:11

nelsongames (78 views)
2018-04-24 18:15:36

nelsongames (71 views)
2018-04-24 18:14:32

ivj94 (753 views)
2018-03-24 14:47:39

ivj94 (83 views)
2018-03-24 14:46:31

ivj94 (624 views)
2018-03-24 14:43:53

Solater (99 views)
2018-03-17 05:04:08

nelsongames (180 views)
2018-03-05 17:56:34

Gornova (406 views)
2018-03-02 22:15:33

buddyBro (1066 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!