5.2 KiB
5.2 KiB
Source Runtime Notes
- Startup scene source has Canvas/root/ui/scene and two cameras.
- Stage 1A decodes the window and camera source values: design size
720 x 1280,root/scenesize3320 x 2560, main camera position(0, 0, 1000), orthographic height640,_near=0, and_far=2000. - Stage 1A camera visibility is
1083179010. Generated world nodes use source layer bit1073741824; UI_2D layer33554432is not used for these world nodes because the source camera does not include it. - Startup scene Canvas source row
[15,-6,-5]resolves_cameraComponent=-5through compiled-json refs record[0,3,7], so Canvas binds theroot/ui/uiCameracomponent. The main world camera is not Canvas-bound; its Camera component serializes_orthoHeight=640, and the source camera-controllerminZoom=0.8makes the generated startup world-camera height640 / 0.8 = 800. - At tall viewport
686 x 1502, runtime verification reportsview.scaleX=view.scaleY=0.9527777777777777,mainCamera.orthoHeight=800, anduiCamera.orthoHeight=788.2215743440233. The empty-land bubble, seed list, and selected-land frame are UI-layer nodes rendered byroot/ui/uiCamera, so their screen size is source UI size multiplied by the current SHOW_ALL view scale, with node world scale still(1,1,1). - Stage 1A mounts
farm_scene_v3at(0, -43.566, 0)and emits only world-map background nodes. - Stage 1A background resources are runtime-selected by
FarmEnv, not by the low-resolutionmodel/v3/scenefallback textures. FarmEnvid6bindsfarm_scene_v3/Scene/BgLayer/defaultbgtodelayRes/scene/bg/spriteFrame, position(0, 1248.749), size3320 x 1404.FarmEnvid7bindsfarm_scene_v3/Scene/FgLayer/defaulttodelayRes/scene/fg/spriteFrame, position(0, -316.229), size3320 x 2472.- Cocos Creator 3.8 import rules for Stage 1A must preserve source SpriteFrame metadata and source pixel dimensions for
scene/bgandscene/fg. farm_scene_v3_spritecontains 36 static visual land cells underScaled/Rotate/GridOrigin.- The visible land count rule is decoded from
farm_scene_v3:gridX=4,gridY=6, 24 visualgrid_*nodes, plus matchingPlantOriginlogic points. The 36-cellfarm_scene_v3_spritegrid is excluded from visible-land placement. - Each visible
grid_*/iconis serialized as sourcesp.Skeleton, with UITransform161.32 x 96.02, anchor about(0.494, 0.503), local position(98.011, 0, 0),_preCacheMode=1,_cacheMode=1, and_enableBatch=true. - Source
scene_landsp.SkeletonDatais embedded in the compact prefab and contains atlasText, textureNames["scene_land.png"], skeletonJson, skins, and animations includingland_valid1..5,land_dry1..5, andland_locked. - Cocos Creator 3.8 requires
scene_landto be generated as an externalspine-dataasset. Inline scenesp.SkeletonDatawas stripped from_skeletonDatareferences by the web-mobile build, leaving invisible lands. - Stage 1B generated external
assets/spine/stage1/scene_land.json,.atlas,.png; runtime capture requested the generated atlas PNG and ROI passed. - Default house and doghouse come from
SkinCfgrecords201001and205001, not only from the static visual prefab. - Bottom menu source nodes are under
main_ui_v2/Menu; feature logic for warehouse/shop/friend/task is outside first-stage scope. - Current two-layer viewport pass no longer regenerates
CocosFarm/assetsthroughtools/generate_creator_project.py. The Cocos Creator project settings use the source design resolution720 x 1280, policy2. - Current runtime layer split:
root/sceneowns the main map layer andStage1MainWorldLayer;root/uiowns the fixed UI layer andStage1FixedUiLayer. root/scene/Cameraandroot/ui/uiCameraremain as required Cocos render cameras. The old camera-node viewport-control scripts are not attached to the camera nodes.Stage1MainWorldLayerpreserves the source startup map view by assigning the source-derived main camera orthographic height640 / 0.8 = 800.Stage1FixedUiLayerkeeps UI in source Cocos design coordinates by assigning the UI camera orthographic height to1280 / 2and keeping theroot/uiUITransform at720 x 1280.- Runtime calls to
view.setDesignResolutionSize()are intentionally absent from the layer components. The runtime capture proved calling it inside resize callbacks can keep firing design-resolution events and produce a black frame. - Under the current two-layer rule, land click hit testing projects each
grid_*/iconcenter through the main camera, while popup placement converts that screen position through the fixed UI camera. - Runtime verification should report design resolution
720 x 1280,mainCamera.orthoHeight=800, anduiCamera.orthoHeight=640; official device preview must not replace the recovered source UI coordinate system with its current CSS visible size. - Browser preview may still scale the outer canvas to fit the selected device shell, but the recovered scene and fixed UI layers stay in source
720 x 1280coordinates. - Runtime blank-click verification reports interaction hidden after non-land click:
interactionActive=false,landBubbleActive=false,seedBg3.activeInHierarchy=false,seedBg5.activeInHierarchy=false, and selected frame inactive.