Skip to content

Conversation

Ananth1839
Copy link

Clipboard Text Example for raylib

A comprehensive demonstration of clipboard text operations using raylib's core functionality. This example shows how to implement copy-paste features in your games and applications.

🎯 Features

  • Copy to Clipboard: Send any text to system clipboard
  • Paste from Clipboard: Retrieve text from system clipboard
  • Text Input Handling: Real-time character input with backspace support
  • Keyboard Shortcuts: Ctrl+C (copy) and Ctrl+V (paste) integration
  • Interactive UI: Buttons with hover effects and visual feedback
  • Sample Texts: Pre-loaded texts for easy testing
  • Cross-Platform: Works on Windows, macOS, and Linux

🚀 Usage

  1. Type text in the input field
  2. Click Copy or press Ctrl+C to copy to clipboard
  3. Click Paste or press Ctrl+V to paste from clipboard
  4. Use Sample Text to load pre-defined texts
  5. Clear to reset the input field

🛠️ Code Highlights

  • SetClipboardText() - Copy text to system clipboard
  • GetClipboardText() - Retrieve text from system clipboard
  • Real-time text input handling
  • Interactive button states
  • Keyboard shortcut detection

📁 Files

  • core_clipboard_text.c - Main example code
  • core_clipboard_text.png - Example screenshot (800x450)

🔧 Building

gcc -o clipboard core_clipboard_text.c -lraylib
./clipboard

@raysan5 raysan5 changed the title Add core_clipboard_text example for raylib [examples] Added core_clipboard_text Oct 9, 2025
Description
This example demonstrates how to create complex diagrams combining geometric shapes with formatted multiline text. It showcases text wrapping, alignment, and positioning within various shapes.

Key Features:

Multiline text rendering with automatic word wrapping

Text alignment (left, center, right) within shapes

Integration of text with geometric shapes (rectangles, circles, polygons)

Visual demonstration of text formatting and layout techniques

Responsive text sizing and positioning

Use Cases:

Creating annotated diagrams and flowcharts

Building educational materials with labeled shapes

Generating technical documentation with visual aids

Designing UI mockups with text elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant