Ú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
- PlayStation 5
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Debrecen és környéke adok-veszek-beszélgetek
- BestBuy topik
- Xiaomi 17 - még mindig tart
- Apple MacBook
- exHWSW - Értünk mindenhez IS
- Fejhallgató erősítő és DAC topik
- Kerékpárosok, bringások ide!
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- További aktív témák...
- iPad 10 Eladó Újszerű GARIS!! INGYEN CSOMAGKÜLDÉS!!
- ASUS TUF A15 - 15.6"FHD 144Hz - Ryzen 7 7445HS - 16GB - 512GB - Win11 - RTX 3050 - Garancia
- Innosick, Samsung Laptop memória DDR5 5600Mhz // ÚJ // Számla // Garancia //
- Új Gamer PC - Ryzen 7 5700X / RX 9060 XT 16GB / B550M WIFI / 32GB RAM 3600MHz / 1TB NVMe SSD
- Panasonic ToughBook FZ-55-2 11.gen. I5 laptop (Intel I5-1145G7 8X4400 Mhz, 16GB DDR4, 512GB NVME)
- Apple iPhone 15 128 GB Black 1 év Garancia Beszámítás Házhozszállítás
- ÁRGARANCIA!Épített KomPhone i5 14600KF 32/64GB DDR5 RAM RX 9070 16GB GAMER PC termékbeszámítással
- Részletre elérhető , BankMentes lehetőség Dell Alienware AW3225QF 31.6 4K QD OLED Gaming Monitor
- 222 - Lenovo LOQ (15IRX10) - Intel Core i5-13450HX, RTX 5050
- iPhone 14 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS4422
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest




