• S'inscrire
    • Se connecter
    • Recherche
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes

    Non résolu Problème curseur

    Support pour les moddeurs
    1.12.2
    1
    1
    64
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • D
      Driss2003 dernière édition par robin4002

      Bonjour j’essayé de trouver un moyen de changer mon curseur inGame sauf que cele ne fonctionne pas. Je suis sur d’avoir fait une erreur quelque part mais je ne sais pas ou.

      Pouvez vous m’aider s’il vous plait, je vous serait trés reconnaissant.

      Voici mon code actuel de mon client Proxy:

      public class ClientProxy extends CommonProxy
      {
      	public static KeyBinding key;
      	public static KeyBinding key2;
      	@Override
      	public void preInit()
      	{
      		super.preInit();
      		
      	}
      
      	
      	
          @SubscribeEvent
          public void onInitGuiEvent(InitGuiEvent.Post event)
          {
          	for (Object b : event.getButtonList()) {
          		if (((GuiButton) b).id == 14) {
          			((GuiButton) b).visible = false;
          		}
          	}
      
          }
      
       
       public ClientProxy()
       {
      	 
      	 MinecraftForge.EVENT_BUS.register(this);
      	 FMLCommonHandler.instance().bus().register(this);
      	
      	 key = new KeyBinding(".keytuto", org.lwjgl.input.Keyboard.KEY_G, "key.categories.gameplay");
      	 ClientRegistry.registerKeyBinding(key);
      	 
      	 
      	 key2 = new KeyBinding(".keytuto", org.lwjgl.input.Keyboard.KEY_F, "key.categories.gameplay");
      	 ClientRegistry.registerKeyBinding(key2);
      	 
      	 
      	 
      	 
      	 
      	 
      	 
      	Display.setTitle("Winds Isle");
       }
       
       @SubscribeEvent
       public void onEvent(KeyInputEvent event)
       {
      	 if(key.isPressed())
      	 {
      		 keyPressed();
      	 }
      	 
      	 
      	 
      	 
      	 if(key2.isPressed())
      	 {
      		 keyPressed2();
      	 }
       
       
       }
      
       
       private void keyPressed() {
      	 
      	 Minecraft.getMinecraft().displayGuiScreen(new Guitest());
      	 
       }
       
       
       
       
       private void keyPressed2() {
      
      	 
       }
      	    @Override
      	    public void registerRender()
      	    {
      	        this.setCursor(Reference.MOD_ID, "/textures/misc/cursor.png", 32, 32, 3.1415926536);
      	    }
      	 
      	    private void setCursor(String modid, String path, int width, int height, double rotation)
      	    {  
      	        AffineTransform transform = new AffineTransform();
      	 
      	        try
      	        {
      	            BufferedImage cursorTexture = ImageIO.read(getClass().getResource("/assets/" + modid + path));
      	            transform.rotate(rotation, cursorTexture.getWidth()/2, cursorTexture.getHeight()/2);
      	 
      	            AffineTransformOp op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
      	            cursorTexture = op.filter(cursorTexture, null);
      	 
      	            int[] rgbs = new int[cursorTexture.getWidth() * cursorTexture.getHeight()];
      	 
      	            IntBuffer buffer = IntBuffer.wrap(cursorTexture.getRGB(0, 0, cursorTexture.getWidth(), cursorTexture.getHeight(), rgbs, 0, cursorTexture.getHeight()));          
      	 
      	            buffer.rewind();
      	 
      	            Cursor newCursor = new Cursor(width, height, 1, cursorTexture.getHeight() - 1, 1, buffer, null);
      	            Mouse.setNativeCursor(newCursor);
      	        }
      	        catch (LWJGLException e) {
      	            e.printStackTrace();
      	        }
      	        catch (IOException e) {
      	            e.printStackTrace();
      	        }
      	    }
      }
      
      1 réponse Dernière réponse Répondre Citer 0
      • 1 / 1
      • Premier message
        Dernier message
      Design by Woryk
      Contact / Mentions Légales

      MINECRAFT FORGE FRANCE © 2018

      Powered by NodeBB