Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i create a circle which has a number in?

I'm programming an Android game using AndEngine. I want to create a circle which has a number in, like in this picture:

like image 833
Kadir Avatar asked Apr 10 '12 21:04

Kadir


People also ask

How do I type a number in a circle in Excel?

Right-click on the cell, click on Format Cell, Alignment and select Center for both Horizontal and Vertical. On the "ribbon" (toolbar), click on Insert, Shapes and select the oval. (You can drag the corners to make it a circle per se.)

How do you put a circle around a number in PowerPoint?

This is perfectly easy to do in MS PowerPoint. You simply use Insert -->Shapes, select the circle shape, type a number inside the circle, and then drop the circle on top off the picture where you want to showcase something.

What is a number circle?

The square number of a number ends with the same digits as the number itself. That number is known as automorphic number or circular number.


2 Answers

Something like this:

circle.xml (in res/drawable)

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval" >

    <solid android:color="#aaf" />

</shape>

and circletext.xml (in res/layout):

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:orientation="vertical" >

    <TextView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_gravity="center"
        android:background="@drawable/circle"
        android:gravity="center"
        android:shadowColor="@android:color/white"
        android:shadowRadius="10.0"
        android:text="4"
        android:textColor="@android:color/black"
        android:textSize="18sp" />

</FrameLayout>

looks like this:

enter image description here

like image 163
Alec B. Plumb Avatar answered Oct 04 '22 03:10

Alec B. Plumb


Well I guess the simplest way is to just put a picture like that in haha. You could always use an image with a circle then layer the text with the number over the top of it.

like image 35
WingDev Avatar answered Oct 04 '22 02:10

WingDev