require "sprite" (pre Graphics 2.0)

Hello,

I have a question regarding the sprite-legacy-module.

Assuming that I am using Corona Version 2013.1256 (2013.11.6) (ie. pre Graphics 2.0)… if I were to include the sprite.lua from the sprite-legacy-module in my project folder, when I do the following:

local sprite = require("sprite");

Will my variable “sprite” be using the sprite library from the sprite-legacy-module? Or will it still be using the deprecated sprite library from Corona? If the latter, is there a way I can have the sprite.lua from the sprite-legacy-module override the Corona sprite library?

Thank you for your time and have a nice day!

It will be using the sprite library from the sprite-legacy module.

The “sprite” library has been removed from the Corona core, so if you do require('sprite") without including the legacy sprite module it will throw a runtime error saying it cannot find “sprite”

Hope this helps :slight_smile:

@euphoriacorona

Thank you very much for your response. Correct me if I’m wrong, but in the Corona version 2013.1256, I believe the sprite library has not been removed yet. 

I ask because I’m still using sprite.* and will be migrating to Graphics 2.0 soon, where sprite.* is no longer included. But before I fully migrate, I’d like to test the legacy module in this previous version of Corona (2013.1256). I can do this easily if 

local sprite = ("sprite") 

uses the legacy module instead of the old sprite library. If not, though, I’ll have to test it another way.

If you are using build 1256, it will probably use the built in version.   If you want to use the copy in your project, rename it to legacysprite.lua and then do:

sprite = require(“legacysprite”)

Thank you, Rob

It will be using the sprite library from the sprite-legacy module.

The “sprite” library has been removed from the Corona core, so if you do require('sprite") without including the legacy sprite module it will throw a runtime error saying it cannot find “sprite”

Hope this helps :slight_smile:

@euphoriacorona

Thank you very much for your response. Correct me if I’m wrong, but in the Corona version 2013.1256, I believe the sprite library has not been removed yet. 

I ask because I’m still using sprite.* and will be migrating to Graphics 2.0 soon, where sprite.* is no longer included. But before I fully migrate, I’d like to test the legacy module in this previous version of Corona (2013.1256). I can do this easily if 

local sprite = ("sprite") 

uses the legacy module instead of the old sprite library. If not, though, I’ll have to test it another way.

If you are using build 1256, it will probably use the built in version.   If you want to use the copy in your project, rename it to legacysprite.lua and then do:

sprite = require(“legacysprite”)

Thank you, Rob