- Milyen egeret válasszak?
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Kormányok / autós szimulátorok topikja
- Milyen billentyűzetet vegyek?
- Milyen TV-t vegyek?
- OLED TV topic
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- AMD Navi Radeon™ RX 9xxx sorozat
- eGPU tapasztalatok
- AMD GPU-k jövője - amit tudni vélünk
Ú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
- Milyen egeret válasszak?
- Motorola Edge 50 Neo - az egyensúly gyengesége
- One mobilszolgáltatások
- iPhone topik
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Víz- gáz- és fűtésszerelés
- Kormányok / autós szimulátorok topikja
- Filmvilág
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Parfüm topik
- További aktív témák...
- BESZÁMÍTÁS! MSI B760M i7 12700 16GB DDR5 512GB SSD RTX 3080 10GB Lian LI LANCOOL 207 GIGABYTE 750W
- RTX 5090-es, 5080-as stb... GAMER laptopok + dokkolók + licencek
- BESZÁMÍTÁS! MSI B650 R7 7700 64GB DDR5 1TB SSD RX 7900 XTX 24GB Lian Li LANCOOL 216 ARGB 850W
- Honor 90 256GB, Kártyafüggetlen, 1 Év Garanciával
- magyar billentyűzet - 165 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs




