public void sceneInit(Activity aIn, boolean visible) { textBeaconList = new TextObject("", aIn, Globals.newId()); textBeaconList.getElement().setTextSize(Globals.getTextSize() * 1.8f); addElementToView(textBeaconList); super.sceneInit(aIn, visible); handler.postDelayed(runnable, 100); }
@Override public void sceneInit(Activity aIn, boolean visible) { itemSetup(aIn); Bitmap b = Bitmap.createBitmap(Colour.ArrFromRGB(0, 0, 0, 180), 1, 1, Bitmap.Config.ARGB_8888); menuOverlay = new ImageObject(b, aIn, Globals.newId(), false); menuOverlay.setLayoutParams( new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT)); menuOverlay.getElement().setScaleType(ScaleType.FIT_XY); menuOverlay.getElement().setClickable(false); menuOverlay.setVisibility(View.GONE); int marginWidth = (int) (Globals.screenDimensions.x / 2 - (menuFactsSylvie.getWidth() * 1.3f)); menuFactsFieldGun.addRule(RelativeLayout.ALIGN_PARENT_LEFT); menuFactsFieldGun.getLayoutParams().setMargins(marginWidth, 0, 0, 0); menuFactsSylvie.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); menuFactsSylvie.getLayoutParams().setMargins(0, 0, marginWidth, 0); menuFactsLoco.getLayoutParams().setMargins(marginWidth, 0, 0, 0); menuFactsLoco.addRule(RelativeLayout.ALIGN_PARENT_LEFT); menuFactsLoco.addRule(RelativeLayout.ABOVE, menuFactsFieldGun.getId()); menuFactsTank.getLayoutParams().setMargins(0, 0, marginWidth, 0); menuFactsTank.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); menuFactsTank.addRule(RelativeLayout.ABOVE, menuFactsSylvie.getId()); menuFactsPlanePropellers.getLayoutParams().setMargins(marginWidth, 0, 0, 0); menuFactsPlanePropellers.addRule(RelativeLayout.ALIGN_PARENT_LEFT); menuFactsPlanePropellers.addRule(RelativeLayout.BELOW, menuFactsFieldGun.getId()); menuFactsCrawler.getLayoutParams().setMargins(0, 0, marginWidth, 0); menuFactsCrawler.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); menuFactsCrawler.addRule(RelativeLayout.BELOW, menuFactsSylvie.getId()); menuContinue = new ButtonObject("CONTINUE\nPLAYING", aIn, Globals.newId()); menuContinue.getElement().setTypeface(Globals.Fonts.MajorShift()); menuContinue.getLayoutParams().setMargins(0, Globals.screenDimensions.y / 36, 0, 0); menuContinue.getElement().setTextSize(Globals.getTextSize() * 1.4f); menuContinue.getElement().setBackgroundColor(android.graphics.Color.TRANSPARENT); menuContinue.addRule(RelativeLayout.BELOW, menuFactsPlanePropellers.getId()); menuGallery = new ButtonObject("VIEW\nGALLERY", aIn, Globals.newId()); menuGallery.getElement().setTypeface(Globals.Fonts.MajorShift()); menuGallery.getLayoutParams().setMargins(0, 0, 0, Globals.screenDimensions.y / 36); menuGallery.getElement().setTextSize(Globals.getTextSize() * 1.8f); menuGallery.getElement().setBackgroundColor(android.graphics.Color.TRANSPARENT); menuGallery.addRule(RelativeLayout.ABOVE, menuFactsLoco.getId()); listMenuScreen.add(menuOverlay); listMenuScreen.add(menuGallery); for (int i = 0; i < 6; i++) listMenuScreen.add(menuFactsheets[i]); listMenuScreen.add(menuContinue); listMainScreen.add(mainImageClue); listMainScreen.add(mainTextStatus); listMainScreen.add(mainImageTransportation); listMainScreen.add(mainImagePressMe); listMainScreen.add(mainHealthBar); listMainScreen.add(mainButtonMenu); // listMainScreen.add(mainDebug); listMainScreen.add(mainToggleClue); listMainScreen.add(mainElapsedTime); listMissionScreen.add(missionBackground); listMissionScreen.add(missionButtonNext); listMissionScreen.add(missionText); listMissionScreen.add(missionCrosshair); listMissionScreen.add(crosshairIndicator); listMissionScreen.add(missionGivenStatus); listClueScreen.add(mainImageClue); listClueScreen.add(mainTextStatus); listClueScreen.add(mainButtonMenu); // listClueScreen.add(mainDebug); listClueScreen.add(mainToggleClue); listClueScreen.add(mainElapsedTime); listClueScreen.add(mainTextClue); listClueScreen.add(mainHealthBar); for (AbstractElement a : listMainScreen) addElementToView(a); for (AbstractElement a : listClueScreen) addElementToView(a); for (AbstractElement a : listMenuScreen) addElementToView(a); for (AbstractElement a : listMissionScreen) addElementToView(a); listMainScreen.add(crosshairIndicator); addElementToView(crosshairIndicator); setClickEvents(); setScene(ScreenState.MAIN); super.sceneInit(aIn, visible); Arrays.fill(missionCompletionTimes, 0); Arrays.fill(missionCompletion, false); screenState = ScreenState.MISSION; missionSetup(); crosshairOffsetX = missionCrosshair.getHeight() / 2; crosshairOffsetX -= crosshairIndicator.getHeight() / 2; crosshairOffsetY = missionCrosshair.getWidth() / 2; crosshairOffsetY -= crosshairIndicator.getWidth() / 2; transportOffsetX = mainImageTransportation.getHeight() / 2; transportOffsetX -= crosshairIndicator.getHeight() / 2; transportOffsetY = mainImageTransportation.getWidth() / 2; handler.postDelayed(runnable, 100); }
public void onLoad() { super.onLoad(); this.setVisibility(RelativeLayout.VISIBLE); }