//public void set_actual_character(CharacterLoader aActualChar) public void set_actual_character(CharacterIndex aIndex) { /* * TODO DELETE * //remove the old one * if(mBodyElementOffset != null) * { * mElements.Remove(mBodyElementOffset); * mBodyElementOffset.Element.destroy(); * } * //add the new one * mBody = new FlatBodyObject(aActualChar, Depth + 2); * mBodyElementOffset = new FlatElementMultiBase.ElementOffset(mBody, new Vector3(0,0,0)); * mElements.Add(mBodyElementOffset);*/ var charIcon = ManagerManager.Manager.mCharacterBundleManager.get_image("ICON_S_" + aIndex.StringIdentifier); if (charIcon.Image != null && charIcon.Data != null) { mIcon.set_new_texture(charIcon.Image, charIcon.Data.Size); } else { mIcon.set_new_texture(ManagerManager.Manager.mCharacterBundleManager.get_image("BOX_" + aIndex.StringIdentifier).Image, null); } Character = aIndex; }
public override void Update() { mFlatCamera.update(Time.deltaTime); foreach (FlatElementBase e in mElement) { e.update(Time.deltaTime); } TED.update(Time.deltaTime); ModeNormalPlay.draw_render_texture(mRTCamera); if (!GameConstants.XB1) { if (mManager.mZigManager.DepthView.DepthTexture != null) { mDepthImage.set_new_texture(mManager.mZigManager.DepthView.DepthTexture, new Vector2(160, 120)); } } //TEST CODE FOR XB1 DEPTH/IMAGE DISPLAY CAN DELETE //mDepthImage.set_new_texture((mManager.mZigManager.ZgInterface as MicrosoftZig).mKinect.DepthTexture,new Vector2(160,120)); //if(mManager.mZigManager.ImageView.imageTexture != null) //mColorImage.set_new_texture((mManager.mZigManager.ZgInterface as MicrosoftZig).mColorImageRT,new Vector2(300,300)); /*Material mat2 = new Material(ManagerManager.Manager.mReferences.mXB1ClearShader); * mat2.SetTexture("_MainTex",(mManager.mZigManager.ZgInterface as MicrosoftZig).mKinect.LabelTexture); * mDepthImage.PrimaryGameObject.GetComponentInChildren<Renderer>().material = mat2; * * Material mat = new Material(ManagerManager.Manager.mReferences.mXB1KinectImageMaskingShader); * mat.SetTexture("_MainTex",(mManager.mZigManager.ZgInterface as MicrosoftZig).mKinect.ColorTexture); * mat.SetTexture("_AlphaTex",(mManager.mZigManager.ZgInterface as MicrosoftZig).mKinect.LabelTexture); * mColorImage.PrimaryGameObject.GetComponentInChildren<Renderer>().material = mat;*/ }
public Texture render_gift(int index) { if (index < mStages.Count) { mPlayerImage.set_new_texture(mStages[index].playerTex, new Vector2(2001, 1500) * 1.3f); ModeNormalPlay.draw_render_texture(mFlatCamera); } return(mFlatCamera.RT); }
public void set_difficulty(int difficulty) { string[] labelNames = new string[] { "label_easy", "label_normal", "label_hard", "label_extreme" }; //mIcon.SoftColor = GameConstants.IconDifficultyColorsOverTwo[difficulty]; var tex = ManagerManager.Manager.mCharacterBundleManager.get_image(labelNames[difficulty]); mDiffImage.set_new_texture(tex.Image, tex.Data.Size); }
//this gets called during CHOOSE so BB should be full sized //this gets called by NewGameManager public void begin_new_character(PerformanceStats aChar) { hide_interface(true); var nameFrame = aChar.Character == CharacterIndex.sFetus ? mManager.mCharacterBundleManager.get_image(GameStrings.GetString("NIMIMG1")) : aChar.Character == CharacterIndex.sOneHundred ? mManager.mCharacterBundleManager.get_image(GameStrings.GetString("NIMIMG2")) : mManager.mCharacterBundleManager.get_image("TEXTBOX"); var scoreFrame = aChar.Character == CharacterIndex.sFetus ? mManager.mCharacterBundleManager.get_image("SCORE-FETUS") : aChar.Character == CharacterIndex.sOneHundred ? mManager.mCharacterBundleManager.get_image("SCORE-110") : mManager.mCharacterBundleManager.get_image("SCORE"); mBBNameTextFrame.set_new_texture(nameFrame.Image, nameFrame.Data.Size); mBBScoreFrame.set_new_texture(scoreFrame.Image, scoreFrame.Data.Size); Vector3 textOffset = new Vector3(70, 115, 0) / 2; mBBNameTextFrame.HardPosition = mBBMultiplierImage.HardPosition + new Vector3(mBBNameTextFrame.BoundingBox.width, 140, 0) / 2 + textOffset; mBBScoreFrame.HardPosition = mBBMultiplierImage.HardPosition + new Vector3(mBBScoreFrame.BoundingBox.width, -140, 0) / 2 + textOffset; if (!(aChar.Character == CharacterIndex.sFetus || aChar.Character == CharacterIndex.sOneHundred)) { mBBNameText.Text = aChar.Character.Description.ToUpper() + " (" + aChar.Character.Age.ToString() + ")"; var origPos = mBBNameTextFrame.SoftPosition - new Vector3(mBBNameTextFrame.BoundingBox.width / 2f, 0, 0); float newWidth = mBBNameText.BoundingBox.width + 300; mBBNameTextFrame.mImage.pixel_crop(new Rect(0, 0, newWidth, mBBNameTextFrame.mImage.BaseDimension.y)); mBBNameTextFrame.HardPosition = origPos + new Vector3(newWidth / 2f, 0, 0); string[] labelNames = new string[] { "label_easy_BIG", "label_normal_BIG", "label_hard_BIG", "label_extreme_BIG" }; var diffImage = mManager.mCharacterBundleManager.get_image(labelNames[aChar.Stats.Difficulty]); mBBMultiplierImage.set_new_texture(diffImage.Image, diffImage.Data.Size); mBBMultiplierImage.HardColor = GameConstants.UiWhite; } else { //reset to original pixel crop (for when soft restarting the game) mBBNameTextFrame.mImage.pixel_crop(new Rect(0, 0, mBBNameTextFrame.mImage.BaseDimension.x, mBBNameTextFrame.mImage.BaseDimension.y)); mBBNameText.Text = ""; mBBMultiplierImage.HardColor = GameConstants.UiWhiteTransparent; } }
public CharacterIconObject(CharacterIndex aIndex, int aDepth) { //NOTE these assets were removed since this class is no longer being used. //mBackground = new FlatElementImage(ManagerManager.Manager.mNewRef.pbCharacterIconBackground,aDepth); //mDifficultyStars = new DifficultyObject(ManagerManager.Manager.mNewRef.uiPerfectStar,aDepth+1); mIcon = new FlatElementImage(null, aDepth + 3); if (aIndex.LevelIndex != -1) { var loaded = ManagerManager.Manager.mCharacterBundleManager.get_image("BOX_" + aIndex.StringIdentifier); mIcon.set_new_texture(loaded.Image, null); //loaded.Data.Size); } //TODO delete /* * if(aIcon == null) * { * CharacterTextureBehaviour ctb = (GameObject.Instantiate(ManagerManager.Manager.mReferences.mMiniChar) as GameObject).GetComponent<CharacterTextureBehaviour>(); * mBody = new FlatBodyObject(ctb,aDepth); * GameObject.Destroy(ctb.gameObject); * } * else * mBody = new FlatBodyObject(aIcon,aDepth+3); * mBody.HardShader = ManagerManager.Manager.mReferences.mMiniCharacterShader; */ //mBodyOffset = mDifficultyStars.mImageElements[0].BoundingBox.width/2 + 5; //float starOffset = mBackground.BoundingBox.width/2+5; //float starOffset = 0; mBodyOffset = 0; //mElements.Add(new ElementOffset(mDifficultyStars, new Vector3(-starOffset,-70,0))); mElements.Add(new ElementOffset(mBackground, new Vector3(mBodyOffset, 0, 0))); mElements.Add(new ElementOffset(mIcon, new Vector3(mBodyOffset, 20, 0))); //mElements.Add(new ElementOffset(mBody, new Vector3(mBodyOffset,0,0))); PrimaryGameObject = create_primary_from_elements(); Depth = aDepth; set_perfectness(0); }