scene

Cocos2D: Get layer's position in scene from another class

人走茶凉 提交于 2019-12-25 05:22:30
问题 I'm trying to retrieve the current position of the layer added as a child in a scene while a scene transition is occurring. The transition is an edited Cocos2D transition that slides the layer off the screen while a new one appears. I created my own implementation inside CCActionEase with an update method: #import "JoinedMapsScene.h" #import "JoinedMapsLayer.h" @implementation CCEaseInWithPercentMult -(void) update: (ccTime) t { [other update: powf(t,rate)]; CCScene * scene = [[CCDirector

In Swift on “game over” move from scene to another UIView and dispose the scene?

孤街醉人 提交于 2019-12-25 04:36:19
问题 I have a "life counter" in my game and when it hits 0 = dead - i want to move away from the scene to another UIView - which is game over view - with stats and a button to go back to the home screen (first UIViewController with buttons to start the game and so on. Here is the code of how i move to the Game Over view class GameScene: SKScene,SKPhysicsContactDelegate { var viewController: UIViewController? // more code and functions // ...... func trackLife (lifeCHange: Int){ life = life +

JavaFX - loading FXML file error

心已入冬 提交于 2019-12-25 02:40:39
问题 I have strange problem which is concerned to loading FXML file using Scene Builder 1.0. I have created a class Warrning and after that I add to my package a FXML file and called it WarrningGUI . Creator has created a Contoller class called WarrningGUIContoller . Until then everything was fine. I stared to create a layout for my application. After I added two raw Panels and turned on and off my FXML file in Scene Builder about 2-3 times something like that appeared: And this was in "Detail":

Putting an object on a stage when mouse clicked

北慕城南 提交于 2019-12-25 02:12:00
问题 package javafxapplication36; /** * Copyright (c) 2008, 2012 Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. */ import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.event.ActionEvent; import javafx.event

Move Scene in corona

女生的网名这么多〃 提交于 2019-12-25 01:44:57
问题 I am new to corona and my Problem id I have a long scene and in that I have a ball body. When it moves up i want to move the scene up. How to do this in Corona. 回答1: This is done using a display group to contain your entire scene (the level, the ball, everything) and then move that display group. Physics in Corona don't work between display groups for this very reason, so that that you can move the scene without affecting physics inside the scene. Refer to the "Egg Breaker" sample project. 来源

cocos2D deallocing CCScheduler

£可爱£侵袭症+ 提交于 2019-12-25 00:18:43
问题 This problem started happening when I subclassed CCSprite (Entity) to recieve touch input. When I'm going away from the main scene by pushing to another, I make all Entities remove their delegation from the shared CCTouchDispatcher (ie onExit()). And then reactivate when the main scene returns (onEnterTransistionFinished()). Half of the times this works fine. However, the other times this happens: cocos2d: deallocing <CCScheduler: 0x2323a0> Which I find rather strange. Is it even plausible

How to make one display group stay fixed in every scene in Corona?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 17:01:08
问题 I have a level and status bar display group and I want this group stay at the same place when the scene changes. How can I achieve this? I am using director class for scene changes. 回答1: Do you want an object/group appear in every scene..? Then you can do as follows: -- main.lua -- local director=require("director") local maingroup=display.newGroup() maingroup:insert(director.directorView) director:changeScene("menu") return maingroup -- status.lua -- local function myObject(group,x,y

ANDROID ANDENGINE — Set Scene background as trasparent

假装没事ソ 提交于 2019-12-24 15:27:01
问题 ­I'm starting to use AndEngine in my app. I've used an xml to define the base style of the app. I've defined a scene in which I'll have some draggable sprites. I've imported correctly the xml but the scene appears on top of that with a black background that hides the xml graphics. I need to set the scene with transparent background. How can i do that? 回答1: Actually you can do that. It was at least working some time ago with AndEngine running on top of a Camera preview. It has really been a

How Do I Build Multi-Layered Scenes with AndEngine?

风流意气都作罢 提交于 2019-12-24 08:56:01
问题 I am a noob to android development and i am trying to learn how to use AndEngine. I want to construct a scene where a sprite appears from behind an object in the foreground and then disappears in a whack-a-mole fashion. I've reviewed every example project but can't find anything code that shows how to do this. any help is greatly appreciated. Currently, I am trying to use a sprite to set the foreground scene to no avail. @Override public Scene onCreateScene() { this.mEngine

Can you write two different Java FX scenes as two separate classes?

半世苍凉 提交于 2019-12-23 12:55:51
问题 I'm a beginning Java programmer, finishing up the "Java 101" class at my local university. I'm also pushing myself to learn some extra topics on the side, including Java FX. I've worked through the Java FX tutorials on Oracle's website, plus sat through some YouTube videos, plus read "Java FX for Dummies" (which was the best book I could find for a beginner.) All of this material has taught me a lot of the basics, but some stuff that (should be) relatively simple escapes me. For example: Let