scene

Setting onClickListeners for buttons in scenes programmatically

99封情书 提交于 2019-12-01 19:16:54
问题 I have 2 layouts which contain the same buttons layout_1.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android:text="button2" android:background="@android:color/black" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> and layout_2.xml <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android

How to create android cocos2dx splash screen?

坚强是说给别人听的谎言 提交于 2019-12-01 09:56:15
问题 This is my code I don't know how to create splash screen and how it will direct in my menu screen. All .h must be connected to BaseScreen and the BaseScreen will be the one connected in cocos2d layer. please help me in my codes. Do only thing that appears in my emulator is the sprite which I code in HelloWorldScreen.h SplashScreen.h ifndef __SPLASH_SCREEN_H__ define __SPLASH_SCREEN_H__ include "BaseScreen.h" include "cocos2d.h" class SplashScreen : BaseScreen { public: void update (); static

Unity save everything (snapshot)

社会主义新天地 提交于 2019-12-01 08:20:35
I'm trying to save everything whilst running my program. I want to save every Gameobject with their scripts and variables. I know that it's possible to serialize everything and save it to an XML (and other ways/formats like JSON). This would require alot of work and time. The program may change alot in the future so the upkeep of maintaining this approach would be very time consuming. so I would prefer to use a different approach. In unity it's possible to save and load a scene and I was hoping if someone knows something similair. I know it's possible to save Scenes during runtime like this

Unity save everything (snapshot)

做~自己de王妃 提交于 2019-12-01 06:25:35
问题 I'm trying to save everything whilst running my program. I want to save every Gameobject with their scripts and variables. I know that it's possible to serialize everything and save it to an XML (and other ways/formats like JSON). This would require alot of work and time. The program may change alot in the future so the upkeep of maintaining this approach would be very time consuming. so I would prefer to use a different approach. In unity it's possible to save and load a scene and I was

Change Scene without resize window in JavaFX

房东的猫 提交于 2019-11-30 09:22:01
问题 I'm trying to change Scenes on JavaFX, but without change the window size. However, when I set stage.setScene(scene2); the window size decreases, and I want to keep the both Scenes maximized. I've tried to stage.setMaximized(true) after the stage.setScene(scene2); but the result is the same. How can I fix it? My code: package controller; import java.io.IOException; import javafx.animation.FadeTransition; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene

View of the application javafx

点点圈 提交于 2019-11-29 16:47:48
i was searching in google for hours and i still cant find the right answer, so i have a last chance to come here and ask. i'm making school year JAVA FX project. I'm using NetBeans. I have a point that i can see on the application i have. The problem is: I would like to have a big map (background) and I need to be able to move with my view. For example move by 50 to the right (x). I have Application where I use Stage, Scene, StackPane. I heard something about Dimensions in Java, but i can't use it in javafx application. Is there something similar, what can I use in my Application? Thank you

Cocos2d adding a background image to a layer?

眉间皱痕 提交于 2019-11-29 05:17:22
问题 I just finished reading some of the cocos2d documentation, and as far as I understand to add a background image to a layer you have to do something like: Sprite * bg = [Sprite spriteWithFile:@"Background.png"]; [layer addChild:bg z:0]; Allthough as far as my testing goes you can just directly add the sprite to the scene like this: @implementation IntroScene - (id) init { self = [super init]; if (self != nil) { Sprite * bg = [Sprite spriteWithFile:@"Background.png"]; [bg setPosition:ccp(240,

How to switch scenes in JavaFX

Deadly 提交于 2019-11-29 04:08:29
I have looked on many pages to try and find out how to switch scenes but I have been unsuccessful. I have a calculator and my goal is to select a menu option to change Calculators(ie: basic and scientific). Right now I am just testing so here is my code relevant to this question thus far (I am using Scene Builder): @FXML private MenuItem basic; @FXML private MenuItem testSwitch; public static void main(String[] args) { Application.launch( args ); } @Override public void start(Stage primaryStage) throws Exception { Parent pane = FXMLLoader.load( getClass().getResource( "calculator.fxml" ) );

Scene size in Xcode 6 / SpriteKit / Swift

时间秒杀一切 提交于 2019-11-29 02:24:45
I've been getting stuck doing what should be really simple stuff in Xcode, I am trying to add a sprite to the scene and for it to sit in the bottom left corner: var groundTexture : SKTexture = SKTexture(imageNamed: "dirt-block") var ground : SKSpriteNode = SKSpriteNode(texture: groundTexture) ground.position = CGPointMake(ground.size.width/2, ground.size.height/2) self.addChild(ground) This doesn't show anything, so I took a look at what the scene dimensions are and self.frame.size.width and self.frame.size.height are returning a width of 1024 and a height of 768, regardless of orientation. I

Changing Scenes in JavaFX NullPointerException

僤鯓⒐⒋嵵緔 提交于 2019-11-28 06:05:46
问题 I'm wanting to change to a scene in another class but I'm having great difficulty. Now the I can move to the to the second screen no problem, but moving back to the first screen gives me the NullPointerException . Help would be much appreciated. Many thanks in advance. Main Class public class Main extends Application { Stage ps; Group root = new Group(); Scene s = new Scene(root, 300, 300, Color.AQUA); Controller con = new Controller(); public void start(Stage primaryStage) throws Exception {