madhurakhal Posted December 3, 2015 Share Posted December 3, 2015 Hi I am working in one of the HTML5 app and trying to learn PIXI.js. While using .JPG Image every things works fine but not shown in the state. The same code shows other images in other format like .jpeg and .pngIs there any thing i have to do to render the image Here is the code.'use strict';/// <reference path="../typings/tsd.d.ts" />/*global $, PPT, Circle, Cross, CircleCross*/(function() { let Container = PIXI.Container, autoDetectRenderer = PIXI.autoDetectRenderer, loader = PIXI.loader, resources = PIXI.loader.resources, Sprite = PIXI.Sprite; let currentImageIndex = 0; let renderer = autoDetectRenderer(938, 800); let stage = new Container(); renderer.render(stage); document.getElementById('workspace-holder').appendChild(renderer.view); let runApp = () => { renderer.render(stage); requestAnimationFrame(runApp); } let setup = () => { let img = new Sprite(resources["assets/images/6.JPG"].texture); img.x = 0; img.y = 0; stage.addChild(img); renderer.render(stage); runApp(); }; let handleImageLoadingProgress = (loader, resources) => { // handle resources progress here } $(function() { loader .add("assets/images/6.JPG") .on('progress', handleImageLoadingProgress) .load(setup); })}()); ThanksMadhu Rakhal Magar Quote Link to comment Share on other sites More sharing options...
xerver Posted December 3, 2015 Share Posted December 3, 2015 Try lowercasing the extension. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 3, 2015 Share Posted December 3, 2015 PIXI doesnt recognize "JPG", use "jpg" instead Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.