game-engine

Andengine (gles2) - ButtonSprite don't react on click

与世无争的帅哥 提交于 2019-12-08 05:22:46
问题 I have code like this: mButton = new ButtonSprite(400 , 400, myTiledTextureRegion.getTextureRegion(0), myTiledTextureRegion.getTextureRegion(1), activity.getVertexBufferObjectManager(), new OnClickListener() { @Override public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) { Toast.makeText(MenuScene.this.activity, "Clicked", Toast.LENGTH_LONG).show(); } }); this.attachChild(mButton); My problem is that when I Click on my button i don' t get toast

css div grow upwards dynamically

感情迁移 提交于 2019-12-08 02:02:42
问题 Basically, i'm building a game. In my game I wan't the players to be able to speak with each other. You have a figure, and when you speak, your text goes in a speak bubble div over your character. My dilemma is, that when i type to much text in the bubble, the bubble expands over the character. So i want the bubble to grow upwards. I've been trying to think of a way to do this in both JS and CSS, but i'd had to give up and ask you guys. Here's an example: http://jsfiddle.net/tDrNN/ HTML <div

Is there any way to ignore libgdx images Limitation? (images must be power of two)

两盒软妹~` 提交于 2019-12-07 17:17:23
问题 In libgdx framework we can only use images power of two ( 64x256 , 128x32 , etc) Because OpenGL requires it. Is there any good way to "pass" this limitation? For example: Use images 800x480 . 回答1: Do set Texture.setEnforcePotImages(false); and you do not have the limitation anymore. So it's not true that you just can use pictures with the size power of two. It's just a "can have" not a "must have". Regards 回答2: You can use non pot textures, e.g. by using opengl es2.0. But it is good practice

Libgdx Game - Texture Scaling

点点圈 提交于 2019-12-07 16:39:37
问题 I am using LibGdx to develop a simple game for Android devices. I wish to show a progress bar using the Texture by scaling it up / down. When we do scaling the image is changing in its shape. Could you please let me know a best approach to achieve the below mentioned scenario. Scale up is fine.. Scale down is really a problem. 回答1: If you want to do it purely by scaling, you can do one of the following Use a mask on the green bit (use for example the blue part as a mask) Chop the green part

Libgdx project for iOS displaying libgdx splash when compiling through robovm on simulator?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 10:01:26
问题 How can I remove libgdx splash screen which appears on iOS simulator but doesn't showed up in android emulator. I am compiling my libgdx project through robovm. Thanks 回答1: You will need to replace the various "Default-" images which are in the RoboVM iOS project's "data" folder. These are the iOS "launch images" described here 来源: https://stackoverflow.com/questions/23004517/libgdx-project-for-ios-displaying-libgdx-splash-when-compiling-through-robovm-on

Ambigious OpenGL Default Camera position

风格不统一 提交于 2019-12-07 06:58:58
问题 in my Opengl programs (before i apply perspective projection matrix) whenever i draw some object I draw it at the origin of the world coordinate system, however almost all of the Opengl tutorials states that the camera (My projection view) is located at the origin looking toward positive z-axis (which depends on how you treat z value in the projection matrix later on), however if that is true how does my camera (located in the origin) is able to view an object located in the origin. Note: i

libgdx - how to add background image in stage?

纵饮孤独 提交于 2019-12-06 21:27:04
问题 I am learning libgdx but i am stuck at a point.. I have added a button in my stage , now i want to add a image in the stage so that the image looks as the background image to the button.i mean to say that the button should lie on the image. I have been looking tutorials but not been able to do that. How can it be done? any help? 回答1: The only thing you need to do is to draw the background, before drawing the Button s. There are a few possible ways to do that: - You can add the background as

Difference between libgdx Stage and Screen

断了今生、忘了曾经 提交于 2019-12-06 18:43:10
问题 I'm making a game, and I see in tutorials some people using Stage class, and others using the Screen class, but I can't figure out the diference. 回答1: A Stage holds Actor instances and updates/animates them and manages hit-detection among them. Its the root of the scene2d "scene graph" API. The Stage is one way of managing the list of objects to draw, their state on the screen (textures, animation state, size, etc), and their interactions with the user. The provided Stage code in Libgdx is

css div grow upwards dynamically

拟墨画扇 提交于 2019-12-06 14:24:45
Basically, i'm building a game. In my game I wan't the players to be able to speak with each other. You have a figure, and when you speak, your text goes in a speak bubble div over your character. My dilemma is, that when i type to much text in the bubble, the bubble expands over the character. So i want the bubble to grow upwards. I've been trying to think of a way to do this in both JS and CSS, but i'd had to give up and ask you guys. Here's an example: http://jsfiddle.net/tDrNN/ HTML <div class="wrapper"> <div class="character1" style="position: absolute; top: 124px; left: 392px; width:

Thoughts about rendering loop strategies

六眼飞鱼酱① 提交于 2019-12-06 12:03:23
I know that hundreds of variations of these considerations have been posted all over the net. However, I haven't found anything that adresses my exact problem, so I hope you can help me see the light. I'm currently toying with 2D game development in Java using OpenGL. The language and graphics library used is not that relevant to my question though as it has a more general character. I'm attempting to design a general purpose game loop which can be used more or less as is for any game that has moderately heavy graphics (mostly bitmap textures) and possibly even heavier game logic (AI,