A downloadable asset pack

🧩 Overview

This action pack brings a complete in-game photo system to CopperCube, allowing players to take, store, and display photos dynamically.

Key features:

  • Automatically creates a folder for saving photos.

  • Captures screenshots while temporarily hiding or displaying specific nodes (e.g., UI overlays or filters).

  • Applies any photo as a texture to any mesh in the scene.

  • Saves and tracks the number of photos via an .ini file to persist data between sessions.

The system is made up of three customizable actions, each with editor-configurable parameters.

🔧 1. action_InitPhotoSystem — Initialize the Photo System

✅ Purpose:

  • Creates the photo folder (or clears it if specified).

  • Sets the base filename for screenshots.

  • Loads or resets the photo index.

  • Generates a photoData.ini file inside the photo folder to track the number of taken photos.

📌 The photoData.ini file allows the game to remember how many photos exist, even after restarting the scene — making the system persistent.

⚠️ Note: If a photo file is deleted manually from the folder, it will no longer be available in the game. Even though the index remains, the image won’t load because the file is missing.

⚙️ Parameters:

  • PhotoFolder (string) — Name of the folder where photos will be saved (default: Gallery).

  • PhotoName (string) — Base name for photos (default: photo).

  • CleanFolderOnStart (bool) — If true, clears the folder and resets the index on scene start.

📸 2. action_CapturePhoto — Capture Photo with Overlay / Filter

✅ Purpose:

  • Temporarily hides a specified node (e.g., UI).

  • Temporarily shows another node (e.g., overlay filter or date).

  • Waits for one frame to apply visibility changes.

  • Takes a screenshot and saves it with a unique name.

  • Updates the photoData.ini with the new index.

  • Restores the original node visibility after capture.

⚙️ Parameters:

  • NodeToIgnore (scenenode) — Node to hide during photo capture.

  • NodeToRender (scenenode) — Node to show during photo capture (e.g., filter, visual effects).

📌 This is typically triggered by a button or event like “Take Photo”.

🖼️ 3. action_ApplyPhotoToMesh — Apply Photo as Texture to Mesh

✅ Purpose:

  • Uses a CopperCube variable to determine which photo index to load.

  • Loads the image file from the photo folder.

  • Applies it as a texture to a specified mesh and material.

📌 The use of PhotoIndexVariable allows dynamic and flexible switching between images — for example:

  • Swapping images on a character’s in-game phone.

  • Rotating photos on a computer screen.

  • Navigating through a photo gallery or slideshow.

⚠️ If the specified image file does not exist (e.g., deleted manually), the texture will fail to load.

⚙️ Parameters:

  • PhotoIndexVariable (string) — Name of the variable containing the desired photo index.

  • Mesh (scenenode) — Mesh to apply the photo texture to.

  • MaterialIndex (int) — Index of the mesh material that will receive the texture.

📁 File Structure

  • Photos are saved as: ./<PhotoFolder>/<PhotoName>_#.jpg

  • Index data is saved in: ./<PhotoFolder>/photoData.ini

The index system:

  • Keeps track of how many photos have been taken.

  • Prevents overwriting existing photos.

  • Enables resuming from the last photo index on restart.

💡 Example Use Cases

  • In-game camera system: players can take photos during gameplay.

  • Photo filters or overlays: add visual flair, date stamps, effects.

  • Photo gallery viewer: use variables to switch displayed photo.

  • Photo as texture: display photos on objects like phones, monitors, walls, or picture frames.

✅ Quick Setup Guide

  1. Initialization:
    Attach action_InitPhotoSystem to the "Before first drawing do something" event of your scene.

  2. Capture Photo:
    Trigger action_CapturePhoto on a button or keypress.

  3. Display Photo:
    Set the photo index via a CopperCube variable and call action_ApplyPhotoToMesh.

🔧 Additional Notes:

  • You can create a full gallery UI with next/previous photo buttons.

  • Add a preview mesh to show photos dynamically.

  • Link variables to triggers or menus for better user control.

Published 3 days ago
StatusReleased
CategoryAssets
Release date 3 days ago
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorSamGrady
Tagsambiera, coppercube, polaroid, samgrady
Code licenseMIT License

Download

Download
extensions.zip 2.5 kB
Download
Demo.ccb 2.4 MB

Comments

Log in with itch.io to leave a comment.

(+1)

Замечательно!. Проверил, всё хорошо работает. Благодарю.

I really appreciate your kind words! Thanks for taking the time to share your thoughts on my code.

(+1)

Amazing! thanks!

I’m thrilled to hear you liked my code. Thank you for the positive feedback, it truly motivates me to keep improving!

(+1)

Good job, this is amazing 

I appreciate your kind words! Thank you for the encouragement, it inspires me to continue writing good code.

:)