[FREE/PAID] TicTacToe Extension

@Horizon may I know from where onDraw is getting canvas in TicTacToeBoard.java
I am talking about this code

   @Override
    protected void onDraw(Canvas canvas) {
        paint.setStyle(Paint.Style.STROKE);
        paint.setAntiAlias(true);

        drawGameBoard(canvas);
        drawMarkers(canvas);

        if (winningLine == true && game.checkDraw == false) {
            paint.setColor(winningLineColor);
            drawWinningLine(canvas);
        
            if(mlistener != null){
                mlistener.gameWinner(game.getWinner());
            }
        }
    }

Also may I know how can I change your code

1 Like

The view which is created using TicTacToeBoard.java sets up a canvas only and the canvas of onDraw() is returning the canvas which in which you can make changes
You might learn about this(canvas)

Just fork it and clone your repo

Thank You

2 Likes

See I have made this view therefore i know that which code needs to change to change X and O
But it is not possible for me if you can then try

1 Like

Tomorrow I will give you some code. You need to add those in your code and compile extension

1 Like

I think for adding custom letters it can be done through a image of letter. @Horizon you can take help from -

3 Likes

I don't know @Aarush_Kumar
Why don't you try by cloning it

1 Like

Well i have exams mostly soon so i dont have time to make extensions for a month or more :frowning:

1 Like

Then I'll try making it

#Off topic
BTW All the best for your exams

2 Likes

@Horizon I tried this extension but get the error that says the project was saved in a newer version of MIT App Inventor. I would very much like to use this and don't understand the error.

Just click on ok and wait for 1 min it will be loaded

I did that but it would not run in IDE

@Horizon, there is a Label.Click event in the AIA file.

image

You can remove this label one click and you can add a new button and say it as reset game and whenever that button will be clicked then you can say that TicTacToe.reset

Which IDE you are talking about

4 Likes

@horizon MIT with companion

Wait for 2-3 hours
I'll make aia from scratch in MIT app inventor nly and then I'll upload it here

Or @Gordon_Lu will you please post the aia after deleting that lable click event as I need rest for 2 more days :frowning_face_with_open_mouth:

Sure.

TicTacToe.aia (23.4 KB)

3 Likes

Thank you @Gordon_Lu
And I need permission from you that can I add your aia to first post

@Wes_Savage try using this aia

Ok, you can use it.

2 Likes

Added to first post

1 Like