Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Drawing images
Started by richard11 Nov 25 2018 09:08 AM

No replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 542 posts
  • Corona SDK

Hopefully my last stumbling block!


Say I've created the following class:

public class imageOverlay implements com.naef.jnlua.NamedJavaFunction {
    // This reports a class name back to Lua during the initiation phase.
    public String getName() {
        return "imageOverlay";

    // This is what actually gets invoked by the Lua call
    public int invoke(final LuaState luaState) {
        CoronaActivity activity = CoronaEnvironment.getCoronaActivity();
        if (activity == null) {
            return 0;

        activity.runOnUiThread(new Runnable() {
            public void run() {
                CoronaActivity activity = CoronaEnvironment.getCoronaActivity();
                if (activity == null) {

                // Some code to go here

        return 1;

Firstly, how would I modify this so that calling imageOverlay("something") passes "something" as a param to this method?


And secondly, how would I then load "something" in either as a image data directly, or as a path to load an image from, and then render that image to activity.getOverlayView() ?


Presumably I want to use BitmapFactory but exactly how, I've no idea.