Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Story
How we grew from 0 to 3 million users
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

7.8: Objects and Images - p5.js Tutorial

74.5K views
•
October 9, 2015
by
The Coding Train
YouTube video player
7.8: Objects and Images - p5.js Tutorial

TL;DR

Learn to dynamically load and display images in p5.js objects based on user interaction.

Transcript

hi so I've got one last video here in this kind of section which has been all about objects in JavaScript and p5.js and arrays you know been adding objects when you click the mouse I've been changing objects when you click the mouse on top of them you're checking to see if the objects are overlapping each other deleting objects from the array when ... Read More

Key Insights

  • ❓ Preload images using the preload function in p5.js for availability during setup.
  • 😒 Use arrays to store images and associate them with objects dynamically.
  • ❓ Implement random selection of images for objects to introduce variety.
  • ❓ Utilize concatenation to dynamically load images with varying filenames.
  • ❓ Enhance object interactions by incorporating images for more engaging visual displays.
  • 🧘 Consider image modes like Center to control the display position of images.
  • 📁 Optimize image loading by naming files systematically for easier association.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How can images be loaded and displayed in p5.js objects?

Images can be loaded using the preload function and displayed by replacing shapes with the image function in the display method of objects.

Q: How can multiple images be associated with different objects in p5.js?

By storing images in an array and passing the desired image to each object during its creation, different images can be displayed for each object.

Q: How can random selection of images be implemented in p5.js objects?

By using the random function to select an index from the image array dynamically, different images can be assigned to objects based on user interaction.

Q: Can images be loaded dynamically from different filenames in p5.js?

Yes, by concatenating filenames with indexes using the plus operator, images can be loaded dynamically based on the index in the image array.

Summary & Key Takeaways

  • Objects in JavaScript and p5.js can be enhanced by loading and displaying images.

  • Images can be loaded from files and associated with objects using a dynamic approach.

  • By utilizing arrays and random selection, different images can be displayed for each object.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Coding Train 📚

Computer Mouse Conference Demos! (node.js + tensorflow.js) thumbnail
Computer Mouse Conference Demos! (node.js + tensorflow.js)
The Coding Train
Coding Challenge #116: Lissajous Curve Table thumbnail
Coding Challenge #116: Lissajous Curve Table
The Coding Train
9.4: Genetic Algorithm: Looking at Code - The Nature of Code thumbnail
9.4: Genetic Algorithm: Looking at Code - The Nature of Code
The Coding Train
Classifying Poses with ml5.js Part 2 thumbnail
Classifying Poses with ml5.js Part 2
The Coding Train
ITP/IMA Winter Show 2018 thumbnail
ITP/IMA Winter Show 2018
The Coding Train
How to Create Fractal Patterns with Toothpicks thumbnail
How to Create Fractal Patterns with Toothpicks
The Coding Train

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots
  • Open Graph Checker

Company

  • About us
  • Our Story
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.