# \[Solved(more or less)\] fullScreen() width height not existing

**URL:** <https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387>\
**Category:** Processing.py\
**Created:** [January 10, 2019, 12:56pm UTC](https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387 "2019-01-10T12:56:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)\
**Post date:** [January 10, 2019, 12:56pm UTC](https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387/1 "2019-01-10T12:56:01Z")

</div>

```auto
def setup():
    fullScreen()
    
# class BlackHole:
# def __init__ (self):
# self.vec = PVector(height/2,width/2)
    
# def show(self):
# ellipse(height/2,width/2,100,100)
        
# hole = BlackHole()
    
def draw():
    #hole.show()
    ellipse(width/2,height/2,100,100)

```

Why I cant do the same for my class?

Solution:

```auto
def setup():
    fullScreen()
    class BlackHole:
        def __init__ (self):
            self.vec = PVector(height/2,width/2)
        
        def show(self):
            ellipse(width/2,height/2,100,100)
    global hole
    hole = BlackHole()
    

    
def draw():
    global hole
    hole.show()

```

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 10, 2019, 1:21pm UTC](https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387/2 "2019-01-10T13:21:54Z")

</div>

Because you are doing `hole = BlackHole()` outside of `setup()` or `draw()` - which is then using ` __init__ (self)` function to init at the same time.

The thing here is how Processing orders operations: First it runs through your code, defines classes and functions like `setup()` and `draw()` - and only _after_ your code finishes getting parsed, only _then_ it starts using `setup()` and `draw()`.  
As a result, you do `hole = BlackHole()` _before_ `setup()` is run, but it determines `width` and `height` only in `setup()`.

I don’t know how Python works, and I don’t know how to define a thing of BlackHole class without initializing it, so I don’t know how to help properly here. But I think you got the gist of it.

---

<div class="post-metadata">

**Author:** ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)\
**Post date:** [January 10, 2019, 1:24pm UTC](https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387/3 "2019-01-10T13:24:35Z")

</div>

I just needed to know how Processing compiles,  
I tought exactly what you said, but I wasn’t sure  
Thanks

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 10, 2019, 1:26pm UTC](https://discourse.processing.org/t/solved-more-or-less-fullscreen-width-height-not-existing/7387/4 "2019-01-10T13:26:35Z")

</div>

No problem!  
Although, I don’t know if that’s a good practice in Python or not, but I think you could just leave ` __init__ (self)` definition empty, and make `init2(self)` function inside of your class that sets the `PVector`, and then call that `init2(BlackHole)` function in `setup()`.
