Hirdetés
- Házimozi belépő szinten
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Milyen egeret válasszak?
- CES 2026: újraértelmezte a billentyűzet fogalmát a HP
- Vezetékes FÜLhallgatók
- Ventilátorok - Ház, CPU (borda, radiátor), VGA
- A CannonKeys felkavarja a slim profilos billentyűzetek állóvizét
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Bluetooth hangszórók
- TCL LCD és LED TV-k
Új hozzászólás Aktív témák
-
trisztan94
őstag
Valaki meg tudja nekem mondani, hogy az alábbi listener miért nem működik? Se logcat, se console nem dob hibát, még csak warning sincs rá. Semmi. Próbáltam androidon, desktopon is futtatni semmi.
Libgdx-ről lenne szó
TextButton startGameButton = new TextButton( "Start game", getSkin() );
startGameButton.addListener( new InputListener() {
public void touchUp(
InputEvent event,
float x,
float y,
int pointer,
int button )
{
super.touchUp( event, x, y, pointer, button );
game.getSoundManager().play( HowDrunkAreYouSound.CLICK );
//game.setScreen( new StartGameScreen( game ) );
}
} );Mint mondtam, semmi, de semmi nem történik. Hangot teszteltem máshogy, működik, tehát be sem lép a metódusba. Debugger szimplán átugorja.
Ez amúgy egy kicsit módosított kód, ez volt az eredeti amit csórtam:
TextButton optionsButton = new TextButton( "Options", getSkin() );
optionsButton.addListener( new DefaultActorListener() {
@Override
public void touchUp(
ActorEvent event,
float x,
float y,
int pointer,
int button )
{
super.touchUp( event, x, y, pointer, button );
game.getSoundManager().play( TyrianSound.CLICK );
game.setScreen( new OptionsScreen( game ) );
}
} );De ez valszeg a scene2d korábbi verziójával működött, mert hibákat dobál:
.addListener-re: The method addListener(EventListener) in the type Actor is not applicable for the arguments (new DefaultActorListener(){})
new DefaultActorListener() {..}-re : DefaultActorListener cannot be resolved to a type
ActorEvent event-re: ActorEvent cannot be resolved to a type
Nézegettem a scene2d dokumentációját, onnan lestem, hogy mikkel kéne átírni:
"actor.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
System.out.println("down");
return true;
}
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
System.out.println("up");
}
});"Bocsánat, ha nagyon láma kérdés, de egyszerűen semmit sem tudok a jelenséggel kezdeni

Köszönöm!

Új hozzászólás Aktív témák
- Bomba ár! HP ProBook 430 G3 - i5-6GEN I 8GB I 128-256SSD I HDMI I 13,3" HD I Cam I W11 I Garancia!
- Keresünk Galaxy S22/S22+/S22 Ultra
- GYÖNYÖRŰ iPhone 12 Pro Max 128GB Pacific Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3940, 100% Akksi
- Telefon felváráslás!! Samsung Galaxy S22/Samsung Galaxy S22+/Samsung Galaxy S22 Ultra
- Telefon felváráslás!! Xiaomi Redmi Note 11, Xiaomi Redmi Note 11 Pro, Xiaomi 11 Lite
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest




