public void Launch_AnimatedParticle(ParticleInfo info) { // isAdditive = false; this.SetIsAdditive(false); type = info.type; hasGravity = info.hasGravity; isAnimated = info.isAnimated; numAnimFrames = info.numAnimFrames; texture = info.texture[0]; velocity = info.velocity; mapPosition = info.startPosition; rotation = info.rotationStart; for (int i = 0; i < numAnimFrames; i++) { Globals.Assert(i < (int)Enum1.kMaxAnimFrames); animFrame[i] = info.texture[i]; animatedSubtexture[i] = info.animatedSubtexture[i]; timeBetweenAnimFrames[i] = info.timeBetweenAnimFrames[i]; } animTimer = 0; currentAnim = 0; scale = info.scaleStart; scaleSpeed = info.scaleSpeed; alpha = info.alphaStart; screenPosition = (Globals.g_world.game).GetScreenPosition(mapPosition); }
public Billboard(string description) { localPosition = new Default.Namespace.CGPoint(); localPosition.x = 0.0f; localPosition.y = 0.0f; string whatAmI = "BillBoardGameObject_" + description; myObject = new GameObject(whatAmI); myObject.AddComponent <MeshFilter>(); myObject.AddComponent <MeshRenderer>(); myObject.GetComponent <Renderer>().enabled = false; myAtlas = null; myTexture = null; myColour.a = 1.0f; myColour.r = 1.0f; myColour.g = 1.0f; myColour.b = 1.0f; currentSubtextureId = -1; oldScale = -1.0f; usingAlpha = false; materialForColourAndAlpha = null; prevAlpha = -1.0f; }
} ///@property(readwrite,assign) bool usingStrings; //public void SetActionDone(bool inThing) {actionDone = inThing;}///@property(readwrite,assign) bool actionDone; public FrontEndQuery() { //if (!base.init()) return null; unityText = null; textTexture = null; for (int i = 0; i < (int)QueryButton.kNumButtonsOnQuery; i++) { button[i] = new FrontEndButton(i); } for (int i = 0; i < (int)Enum.kMaxFunnyWordsInQuery; i++) { funnyWord[i] = null; } for (int i = 0; i < (int)Enum.kMaxCentralButtonsInQuery; i++) { buttonText[i] = null; } dimZob = new Zobject(); backdrop = new Zobject(); text = new Zobject(); chosenButton = (QueryButton)(-1); noDimZob = false; wordScale = 0.42f; wordGap = 32.0f; wordOffset = 0.0f; myColour = Constants.kColourLightGreen; usingStrings = false; //return this; }
public void ApplyTextureP1P2P3P4P5(Texture2D_Ross inTex, int inSubId, int inAtlasId, int inSpriteSubId, int inSpriteAtlasId, bool inOneDeep) { subTextureId = inSubId; atlasId = inAtlasId; spriteSubTextureId = inSpriteSubId; spriteAtlasId = inSpriteAtlasId; spriteSubOneDeep = inOneDeep; }
public void Dealloc() { if (textTexture != null) { textTexture.Dealloc(); textTexture = null; } if (unityText != null) { unityText.Dealloc(); unityText = null; } if (dimZob != null) { dimZob.Dealloc(); dimZob = null; } if (backdrop != null) { backdrop.Dealloc(); backdrop = null; } if (text != null) { text.Dealloc(); text = null; } for (int i = 0; i < (int)QueryButton.kNumButtonsOnQuery; i++) { if (button[i] != null) { button[i].Dealloc(); button[i] = null; } } for (int i = 0; i < (int)Enum.kMaxFunnyWordsInQuery; i++) { if (funnyWord[i] != null) { funnyWord[i].Dealloc(); funnyWord[i] = null; } } for (int i = 0; i < (int)Enum.kMaxCentralButtonsInQuery; i++) { if (buttonText[i] != null) { buttonText[i].Dealloc(); buttonText[i] = null; } } }
public void Launch_ScalingRipple(CGPoint inStartPosition) { isAdditive = false; scale = 0.5f; mapPosition = inStartPosition; type = ParticleType.kParticle_ScalingRipple; texture = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)ParticleTextureType.kParticleTexture_Ripple); alpha = 1; rotation = 0; }
public Ztransition() { // //if (!base.init()) return null; this.Reset(); zobject = new Zobject(); spinningWord = new Zobject(); pTexture = null; //return this; }
public void InitialiseHealthBar(ZbarInfo info) { type = BarType.e_HealthBar; fillLevel = 100; fillMaximum = 100; displayFillLevel = 0; position = info.position; fillTexture = info.fillTexture; backTexture = info.backTexture; borderTexture = info.borderTexture; }
public void Launch_RainbowStarTrail(CGPoint inStartPosition) { currentAnim = 0; isAnimated = false; isActive = true; timer = 0; int randNumber = 140 + (Utilities.GetRand(120)); float angle = ((float)randNumber) * (Constants.PI_ / 360.0f); float outSpeed = 1.2f * ((Globals.g_world.GetGame()).GetPlayer()).GetActualSpeed().y; velocity = Utilities.GetVectorFromAngleP1(angle, outSpeed); int randX = Utilities.GetRand(20); int randY = Utilities.GetRand(10); float plusX = (float)randX - 10.0f; float plusY = (float)randY - 5.0f; CGPoint startPosition = Utilities.CGPointMake(inStartPosition.x + plusX + velocity.x * 2, inStartPosition.y + plusY + velocity.y * 2); mapPosition = startPosition; const int kNumFrames = 6; int particleId = (int)ParticleTextureType.kParticleTexture_SparkleRed + ((Utilities.GetRand(5)) * kNumFrames); texture = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)particleId); atlas = Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles); myAtlasBillboard.SetAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles)); myAtlasBillboard.SetDetailsFromAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles), 0); subTextureId = (Utilities.GetRand(5)) * 6; for (int i = 0; i < kNumFrames; i++) { animFrame[i] = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)particleId + i); } currentAnim = 0; animTimer = 0; rotation = 0; type = ParticleType.kParticle_RainbowStarTrail; if (isAdditive) { alpha = 0.2f; } else { alpha = 1; } }
public void Launch_MenuSparkle(ParticleInfo info) { this.SetIsAdditive(true); timer = 0; isActive = true; type = ParticleType.kParticle_MenuSparkle; velocity = info.velocity; mapPosition = info.startPosition; texture = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)ParticleTextureType.kParticleTexture_SparkleOrange + Utilities.GetRand(2)); alpha = 0.7f; rotationScale = Globals.g_world.GetRotationScaleForShorts(12.24f); if (Globals.deviceIPad) { rotationScale *= 2.0f; } this.Update_MenuSparkle(); }
public void Launch_SingleParticle(ParticleInfo info) { this.SetIsAdditive(info.isAdditive); timer = 0.0f; isActive = true; type = info.type; velocity = info.velocity; mapPosition = info.startPosition; texture = info.texture[0]; alpha = info.alphaStart; scale = info.scaleStart; rotation = 0; rotationSpeed = info.rotationSpeed; scaleSpeed = info.scaleSpeed; alphaSpeed = info.alphaSpeed; // this.SetupAtlasDetails(); this.Update(); }
//This is for single textures - i.e. not atlases... //The material gets loaded once but could hypothetically be used for a bunch of gmaeobjects... public void SetTexture2D(Default.Namespace.Texture2D_Ross inTextureThing) { myAtlas = null; myTexture = inTextureThing; myObject.GetComponent <Renderer>().sharedMaterial = inTextureThing.myMaterial; if (false) //(Default.Namespace.Constants.ANDROID_25) && (Default.Namespace.Globals.g_main.loadADCQueue.state == LoadADCQueue.State.kStateBuildingUpAssetList)) { // this.SetHeightAndWidth(256.0f, 256.0f); } else { //won't work with ADC yet... this.SetHeightAndWidth(inTextureThing.myMaterial.mainTexture.width, inTextureThing.myMaterial.mainTexture.height); } }
public void InitialiseP1(FrontEnd.ButtonInfo buttonInfo, int inShowStyle) { this.SetDefaults(); sparklesPosition = 0; Zobject.ZobjectInfo info = new Zobject.ZobjectInfo(); info.position = buttonInfo.position; info.texture = buttonInfo.texture; normalTexture = info.texture; info.startState = ZobjectState.kZobjectHidden; info.isMapObject = false; zobject.Initialise(info); zobject.SetShowStyle(inShowStyle); zobject.SetThrobSize(0.1f); zobject.SetThrobTime(0.16f); position = buttonInfo.position; if (buttonInfo.texture != null) { width = (float)(buttonInfo.texture).pixelsWide; height = (float)(buttonInfo.texture).pixelsHigh; } if (Globals.g_main.usingTextureResolution == TextureResolutionEnum.kTextureResolution_High) { width /= 2.0f; height /= 2.0f; } goToScreen = buttonInfo.goToScreen; zobject.SetAtlas(null); //buttonInfo.textureLabel = null; if (buttonInfo.textureLabel != null) { if (zobjectLabel == null) { zobjectLabel = new Zobject(); } info.texture = buttonInfo.textureLabel; zobjectLabel.Initialise(info); zobjectLabel.SetShowStyle(inShowStyle); } }
public void ChangeTexture(Texture2D_Ross newTexture) { zobject.SetTexture(newTexture); if (newTexture == null) { width = 0; height = 0; } else { width = (float)newTexture.pixelsWide; height = (float)newTexture.pixelsHigh; } if (Globals.g_main.usingTextureResolution == TextureResolutionEnum.kTextureResolution_High) { width /= 2.0f; height /= 2.0f; } }
public void SetBackScreen(Texture2D_Ross inTexture) { // need a billboard here to render the texture stored in this Texture2D - and in fact we don't need a t2d here at all if (inTexture == null) { backScreenBillboard = null; return; } if (backScreenBillboard == null) { backScreenBillboard = new Billboard("fescreeback" + myId.ToString()); } backScreenBillboard.SetTexture2D(inTexture); // backScreen = inTexture; }
bool Update_RainbowStarTrail() { timer += Constants.kFrameRate; mapPosition.x += velocity.x; mapPosition.y += velocity.y; alpha -= 0.04f; velocity.x *= 0.85f; velocity.y *= 0.85f; const int kNumFrames = 6; animTimer += Constants.kFrameRate; if (animTimer >= 0.05f) { currentAnim++; if (currentAnim == kNumFrames) { currentAnim = 0; } texture = animFrame[currentAnim]; animTimer = 0; } scale = 2.0f * (0.0f + (Utilities.GetCosInterpolationP1P2(timer + 0.3f, 0.0f, 0.85f) * 1.2f)); if (isAdditive) { scale *= 1.35f; } screenPosition = (Globals.g_world.game).GetScreenPosition(mapPosition); if (!(Globals.g_world.game).IsOnScreen(screenPosition)) { return(true); } if ((scale <= 0.1f) || (alpha < 0.1f)) { return(true); } return(false); }
public void AddLabelP1(Texture2D_Ross inTex, CGPoint inOffset) { labelOffset = inOffset; if (zobjectLabel == null) { zobjectLabel = new Zobject(); } Zobject.ZobjectInfo info = new Zobject.ZobjectInfo(); info.texture = inTex; info.startState = ZobjectState.kZobjectHidden; zobjectLabel.Initialise(info); zobjectLabel.SetShowStyle(zobject.showStyle); zobjectLabel.SetHideStyle(zobject.hideStyle); zobjectLabel.SetWaitToShow(zobject.waitToShow); CGPoint labePos = Utilities.CGPointMake(position.x + labelOffset.x, position.y + labelOffset.y); zobjectLabel.SetScreenPosition(labePos); zobjectLabel.SetState(ZobjectState.kZobjectHidden); }
public void AddToSceneP1P2P3(int inType, CGPoint mapPosition, float inRotation, float inAlpha) { isSimpleObject = false; isSelfRemoving = true; atlas = null; flaggedToRemoveNextFrame = false; flaggedToSwapbackwardNextFrame = false; flaggedToSwapForwardNextFrame = false; position = mapPosition; textureType = inType; texture = (Globals.g_world.game).GetTexture((TextureType)(TextureType)inType); mapObjectGone = false; isOnScreen = false; hasBeenDisplayed = false; rotation = inRotation; alpha = inAlpha; scale = 1; alphaSpeed = 0; subTextureId = -1; type = MapObjectType.e_Whatever; }
public LightBall() { //if (!base.init()) return null; for (int i = 0; i < (int)Enum.kNumBeams; i++) { beam[i] = new LightBeam(); } appearing = false; appearAlpha = 0; beamBaseRotation = 0; angleSpaceBetweenBeams = (Constants.HALF_PI / 6); rotSpeed = 0.1f; ballTexture = null; position = Utilities.CGPointMake(300.0f, 0.0f); beamPosition = Utilities.CGPointMake(320.0f, 0.0f); startAngleForBeams = 0.3f; beamScale = 4.4f; //return this; }
public void Launch_GreenAntScreen(ParticleInfo inInfo) { currentAnim = 0; isAnimated = false; isActive = true; timer = 0; velocity = inInfo.velocity; CGPoint startPosition = inInfo.startPosition; mapPosition = startPosition; const int kNumFrames = 6; int particleId = (int)ParticleTextureType.kParticleTexture_SparkleRed + ((Utilities.GetRand(5)) * kNumFrames); texture = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)particleId); atlas = Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles); myAtlasBillboard.SetAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles)); myAtlasBillboard.SetDetailsFromAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_RainbowParticles), 0); subTextureId = (Utilities.GetRand(5)) * 6; currentAnim = 0; animTimer = 0; rotation = 0; type = ParticleType.kParticle_GreenAntScreen; if (isAdditive) { alpha = 0.2f; } else { alpha = 1.0f; } scale = 1; if (isAdditive) { scale = 1.35f; } }
public void Launch_StarBurst(ParticleInfo info) { this.SetIsAdditive(true); isActive = true; type = ParticleType.kParticle_StarBurst; velocity = info.velocity; mapPosition = info.startPosition; texture = (ParticleSystemRoss.Instance()).GetTexture((ParticleTextureType)ParticleTextureType.kParticleTexture_RainbowPop); alpha = 0.8f; scale = 4.0f; subTextureId = 30; rotation = 0; screenPosition = (Globals.g_world.game).GetScreenPosition(mapPosition); alphaSpeed = 0.04f; if (Globals.g_world.artLevel == 0) { if ((Globals.g_world.game).numPlayersOnScreen >= 3) { alphaSpeed = 0.06f; } } }
public bool Update_Animated() { animTimer += Constants.kFrameRate; mapPosition.x += velocity.x; mapPosition.y += velocity.y; screenPosition = (Globals.g_world.game).GetScreenPosition(mapPosition); if (!(Globals.g_world.game).IsOnScreen(screenPosition)) { return(true); } if (animTimer >= timeBetweenAnimFrames[currentAnim]) { animTimer -= timeBetweenAnimFrames[currentAnim]; currentAnim++; rotationScale = Globals.g_world.GetRotationScaleForShorts(45.2548f); if (Globals.deviceIPad) { rotationScale *= 2.0f; } if (currentAnim == numAnimFrames) { return(true); } else { if (currentAnim >= numAnimFrames) { } subTextureId = animatedSubtexture[currentAnim]; texture = animFrame[currentAnim]; } } return(false); }
public void SetupPointTexture(Texture2D_Ross inTex) { pointTexture = inTex; }
public void InitialiseNew(QueryInfoNew info) { waitToHide = 0.0f; if (unityText == null) { unityText = new FunnyWord(); } if (info.numButtons > 0) { myColour = Constants.kColourRed; } if (Globals.g_main.usingTextureResolution == TextureResolutionEnum.kTextureResolution_High) { info.inTextScale *= 2.0f; } if (Globals.g_world.DoesCurrentLanguageUseNSString() || info.useNSStringForAnyLanguage) { useNSString = true; } else { useNSString = false; } FunnyWord.WordInfo wInfo; wInfo.position = info.position; wInfo.isCentrePos = true; wInfo.scale = info.inTextScale * 0.32f; // * 0.25f; if (useNSString) { unityText.InitWithWordNewP1(wInfo, info.queryText); } else { position = info.position; this.DivideStringIntoFunnyWords(info.queryText); wInfo.scale = info.inTextScale * 0.012f; // * 0.1f;// * 0.25f; //unityText.SetFont(Globals.g_world.font); //unityText.SetColourAtlas(Globals.g_world.GetAtlas(AtlasType.kAtlas_FontColours)); //unityText.InitWithWordP1(wInfo,info.queryText); } unityText.SetColour(myColour); if (useNSString) { unityText.myTextWrapper.SetBoundThing(); unityText.SetUseTextureInstead(true); unityText.myTextWrapper.SetFontSize(info.inTextScale * 0.32f); } newStyleWithAtlas = info.newStyleWithAtlas; newStyleQuery = true; useActualText = false; FrontEndQuery.QueryInfo qInfo = new FrontEndQuery.QueryInfo(); qInfo.noButton = info.noButton; qInfo.yesButton = info.yesButton; position = info.position; state = QueryState.e_Inactive; chosenButton = (QueryButton)(-1); queryText = (info.queryText); boxDimensions = Utilities.CGPointMake(info.boxDimensions.Width, info.boxDimensions.Height); scale.x = info.scale; scale.y = info.scale; atlas = info.inAtlas; if (newStyleWithAtlas) { this.SetupButtonsNew(info); } Zobject.ZobjectInfo zInfo = new Zobject.ZobjectInfo(); if (newStyleWithAtlas) { zInfo.texture = null; } else { zInfo.texture = info.backdropTexture; } zInfo.startState = ZobjectState.kZobjectHidden; zInfo.position = position; zInfo.isMapObject = false; backdrop.Initialise(zInfo); backdrop.SetShowScale(scale.x * 1.2f); if (newStyleWithAtlas) { backdrop.SetAtlasAndSubtextureP1(atlas, info.backdropId); } else { // backdrop.SetShowScale(1.2f); } if (backdrop.myAtlasBillboard != null) { backdrop.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff"); } numButtons = info.numButtons; zInfo.position = Utilities.CGPointMake(160.0f, 240.0f); zInfo.texture = info.dimOverlayTexture; dimZob.Initialise(zInfo); dimZob.SetStretchToScreen(true); dimZob.SetShowStyle((int)ZobjectShowStyle.kZobjectShow_FadeIn); dimZob.SetHideStyle((int)ZobjectHideStyle.kZobjectHide_FadeOut); dimZob.SetShowAlpha(0.7f); if (newStyleWithAtlas) { dimZob.SetAtlasAndSubtextureP1(atlas, info.dimId); } if (dimZob.myAtlasBillboard != null) { dimZob.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff"); } if (textTexture != null) { } CGSize dimensionsForText = info.boxDimensions; float textScale = info.inTextScale; if (Globals.deviceIPad) { dimensionsForText.Height *= 2.0f; dimensionsForText.Width *= 2.0f; textScale *= 2.0f; } textTexture = null; //new Texture2D_Ross(info.queryText, dimensionsForText, UITextAlignment.UITextAlignmentCenter, "Arial", textScale); zInfo.texture = textTexture; zInfo.position = position; if (Globals.g_currentLanguage == World.Enum11.kLanguage_Japanese) { if ((!Globals.deviceIPhone4) && (!Globals.deviceIPad)) { zInfo.position.y += 3.0f; } else { zInfo.position.y += 15.0f; } } text.Initialise(zInfo); text.SetShowScale(scale.x); if (text.myAtlasBillboard != null) { text.myAtlasBillboard.myObject.layer = LayerMask.NameToLayer("guistuff"); } if (!newStyleWithAtlas) { boxDimensions.x = 200.0f; boxDimensions.y = 180.0f; if (info.numButtons == 0) { this.SetupButtons(qInfo); } } if (info.numButtons > 0) { queryButtonStyle = QueryButtonStyle.kQButtonsCentral; this.SetupCentralButtons(info); //This means we want the new style central hanging buttons } else { queryButtonStyle = QueryButtonStyle.kQButtonsEdges; } backdrop.SetShowStyle(ZobjectShowStyle.kZobjectShow_SlideInLeft); backdrop.SetHideStyle(ZobjectHideStyle.kZobjectHide_SlideToRight); backdrop.SetHideAcc(0.02f); unityText.SetPositionZob(backdrop); }
} ////@property(readwrite,assign) Texture2D* pTexture; public void SetPBackTexture(Texture2D_Ross inThing) { pBackTexture = inThing; } ////@property(readwrite,assign) Texture2D* pBackTexture;
public void SetupDigitTexturesP1(int digit, Texture2D_Ross inTex) { Globals.Assert(digit < (int)Enum.kMaxDigitTextures); digitTexture[digit] = inTex; }
} ///@property(readwrite,assign) CGPoint position; public void SetTexture(Texture2D_Ross inThing) { texture = inThing; } ////@property(readwrite,assign) Texture2D* texture;
} ///@property(readwrite,assign) ButtonClickStyle clickStyle; public void SetHighlightTexture(Texture2D_Ross inThing) { highlightTexture = inThing; } ////@property(readwrite,assign) Texture2D* highlightTexture;