Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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  Discussions / Miscellaneous Topics / Re: Problems with Custom Cursor in Shooting Game on: 2012-08-16 17:59:03
plzz.. guys u were helping me out.. thanks Smiley
2  Discussions / Miscellaneous Topics / Re: Problems with Custom Cursor in Shooting Game on: 2012-08-15 20:20:33
and Vladiedoo,

we cant use paint(graphics g) method in JFrames / JPanels or can we..??
3  Discussions / Miscellaneous Topics / Re: Problems with Custom Cursor in Shooting Game on: 2012-08-15 20:07:27
sorry i had no idea where to put the question so i put i here.

and how do i insert pics in this post from my desktop??

and i actually have a 2000 x 1400 px pic (for 1000 X 700 px JFrame) in the centre of which is the reticle.. i want the targets should only be visible through the reticle.. so do i do..

1  
Point cursorHotSpot = new Point(1000,700);


or something else..??
4  Discussions / Miscellaneous Topics / Problems with Custom Cursor in Shooting Game on: 2012-08-15 18:44:02
Hey guys!!
I'm having trouble with having a custom Cursor in shape of a Sniper scope reticle..
what i want is that the the crosshair of the reticle be the mouse pointer but all i get is a small image about 15px X 15px with the top left corner as the mouse pointer..

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;

public class SniperCursor
{
  public SniperCursor()
  {
    JFrame myFrame = new JFrame();
    myFrame.setSize(400,400);
    myFrame.setTitle("Sniper Frame");
    myFrame.setVisible(true);
    myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image cursorImage = toolkit.getImage("MilDotScope.png");
    Point cursorHotSpot = new Point(0,0);
    Cursor customCursor = toolkit.createCustomCursor(cursorImage, cursorHotSpot, "Cursor");
    myFrame.setCursor(customCursor);
  }
  public static void main (String[] arg)
  {
     SniperCursor myWindow = new SniperCursor();
  }
}


if i cant do what i want this way.. is there any other way of doing this.. I thought about using MouseMoved() method on a JLabel with the Reticle set as ImageIcon on the JLabel.. but it is not performing as required. Sad

PLEASE HELP!!
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (44 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org 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‑gaming.org
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!