Ajit Hegde
Ajit Hegde

Reputation: 552

Sudoku Grid in Unity 5

I am new to Unity.

I am converting my Sudoku game written in WPF to Unity2D. I converted everything. However I cant achieve 9*9 grid with Buttons as I did in WPF.

In WPF I created 81 buttons with same event. So when it is called I jsut got their position displayed keyboard with only numbers that cell allowed.

Here is what I needed

enter image description here Here is what I did.

1: I inserted canvas then tried vertical layout(for adding 3 rows) without success

2: Then I tried grid layout with canvas with fixable count column no success

3: grid layout with flexible option still no result.

I also tried via coding using GUI.BOX, and all still the result is not good.

How can I do it?

Upvotes: 0

Views: 1495

Answers (1)

Fattie
Fattie

Reputation: 12336

Do not use GridLayout, it is only for fixed size "icons" - irrelevant here, do not use.

First use VerticalLayoutGroup

include ..

enter image description here

Don't forget you must put a LayoutElement on each of your three items.

Get that working first.

Then, for your MIDDLE item, add a horizontal group and make that work.

Upvotes: 2

Related Questions