private static void showAd(final LuaState luaState, final int verticalAlignment, final int horizontalAlignemnt, final int xOffset, final int yOffset, final double scale) {
        final CoronaActivity activity = CoronaEnvironment.getCoronaActivity();
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {

                if(layout == null) {
                    layout = new FrameLayout(activity);
                    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
                    activity.getOverlayView().addView(layout, layoutParams);
                }

                // Setup the banner
                int width = (int)(320 * scale);
                int height = (int)(50 * scale);

                DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
                if (autoScale) {
                    width = (int)(width * metrics.density);
                    height = (int) (height * metrics.density);
                }

                int gravity = 0;
                switch(horizontalAlignemnt) {
                    case 1:
                        gravity |= Gravity.LEFT;
                        break;
                    case 2:
                        gravity |= Gravity.CENTER_HORIZONTAL;
                        break;
                    case 3:
                        gravity |= Gravity.RIGHT;
                        break;
                    default:
                        gravity |= Gravity.CENTER_HORIZONTAL;
                        break;
                }

                switch(verticalAlignment) {
                    case 1:
                        gravity |= Gravity.TOP;
                        break;
                    case 2:
                        gravity |= Gravity.CENTER_VERTICAL;
                        break;
                    case 3:
                        gravity |= Gravity.BOTTOM;
                        break;
                    default:
                        gravity |= Gravity.BOTTOM;
                        break;
                }

                FrameLayout.LayoutParams viewLayoutParams = new FrameLayout.LayoutParams(width, height, gravity);

                int leftMargin = xOffset;
                int topMargin = yOffset;
                if (autoScale) {
                    leftMargin = (int)(xOffset * metrics.density);
                    topMargin = (int)(yOffset * metrics.density);
                }
                viewLayoutParams.setMargins(leftMargin, topMargin, 0, 0);

                banner = com.tapfortap.Banner.create(activity, EventHelper.bannerListenerInstance);
                banner.setLayoutParams(viewLayoutParams);
                layout.addView(banner);
            }
        });
    }